@rivetkit/supabase 2.3.13 → 2.3.15-rc.1

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.
Files changed (3) hide show
  1. package/dist/mod.js +62 -50
  2. package/dist/mod.mjs +62 -50
  3. package/package.json +3 -3
package/dist/mod.js CHANGED
@@ -519,7 +519,7 @@ function unsupportedFeature(feature) {
519
519
  );
520
520
  }
521
521
 
522
- // ../rivetkit/dist/tsup/chunk-UZWKXBMV.js
522
+ // ../rivetkit/dist/tsup/chunk-WXKBI546.js
523
523
  var import_pino = require("pino");
524
524
 
525
525
  // ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/external.js
@@ -13192,7 +13192,7 @@ var classic_default = external_exports;
13192
13192
  // ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/index.js
13193
13193
  var v4_default = classic_default;
13194
13194
 
13195
- // ../rivetkit/dist/tsup/chunk-UZWKXBMV.js
13195
+ // ../rivetkit/dist/tsup/chunk-WXKBI546.js
13196
13196
  var cbor = __toESM(require("cbor-x"), 1);
13197
13197
  var import_invariant = __toESM(require_invariant(), 1);
13198
13198
  var getRivetEngine = () => getEnvUniversal("RIVET_ENGINE");
@@ -13366,7 +13366,7 @@ function noopNext() {
13366
13366
  }
13367
13367
  var package_default = {
13368
13368
  name: "rivetkit",
13369
- version: "2.3.13",
13369
+ version: "2.3.15-rc.1",
13370
13370
  description: "Lightweight libraries for building stateful actors on edge platforms",
13371
13371
  license: "Apache-2.0",
13372
13372
  keywords: [
@@ -13587,7 +13587,7 @@ var package_default = {
13587
13587
  "@rivetkit/virtual-websocket": "workspace:*",
13588
13588
  "@rivetkit/workflow-engine": "workspace:*",
13589
13589
  "cbor-x": "^1.6.0",
13590
- "drizzle-orm": "^0.44.2",
13590
+ "drizzle-orm": "catalog:",
13591
13591
  hono: "^4.7.0",
13592
13592
  invariant: "^2.2.4",
13593
13593
  "p-retry": "^6.2.1",
@@ -14670,7 +14670,7 @@ function Config({ initialBufferLength = 1024, maxBufferLength = 1024 * 1024 * 32
14670
14670
  };
14671
14671
  }
14672
14672
 
14673
- // ../rivetkit/dist/tsup/chunk-UQINOZ6M.js
14673
+ // ../rivetkit/dist/tsup/chunk-QEVBDSCG.js
14674
14674
  var config2 = /* @__PURE__ */ Config({});
14675
14675
  function readWorkflowCbor(bc) {
14676
14676
  return readData(bc);
@@ -15549,6 +15549,44 @@ function removePrefixFromKey(prefixedKey) {
15549
15549
  return prefixedKey.slice(KEYS.KV.length);
15550
15550
  }
15551
15551
 
15552
+ // ../rivetkit/dist/tsup/chunk-IMADANGF.js
15553
+ function logger() {
15554
+ return getLogger("actor-client");
15555
+ }
15556
+ var webSocketPromise = null;
15557
+ async function importWebSocket() {
15558
+ if (webSocketPromise !== null) {
15559
+ return webSocketPromise;
15560
+ }
15561
+ webSocketPromise = (async () => {
15562
+ let _WebSocket;
15563
+ if (typeof WebSocket !== "undefined") {
15564
+ _WebSocket = WebSocket;
15565
+ } else {
15566
+ try {
15567
+ const moduleName = "ws";
15568
+ const ws = await import(
15569
+ /* webpackIgnore: true */
15570
+ moduleName
15571
+ );
15572
+ _WebSocket = ws.default;
15573
+ logger().debug("using websocket from npm");
15574
+ } catch {
15575
+ _WebSocket = class MockWebSocket {
15576
+ constructor() {
15577
+ throw new Error(
15578
+ 'WebSocket support requires installing the "ws" peer dependency.'
15579
+ );
15580
+ }
15581
+ };
15582
+ logger().debug("using mock websocket");
15583
+ }
15584
+ }
15585
+ return _WebSocket;
15586
+ })();
15587
+ return webSocketPromise;
15588
+ }
15589
+
15552
15590
  // ../rivetkit/dist/tsup/chunk-JTHHCZCZ.js
15553
15591
  var MIGRATION_TRANSACTION_TIMEOUT_MS = 5 * 6e4;
15554
15592
  function isManualTransactionControl(query) {
@@ -15632,45 +15670,7 @@ var AsyncMutex = class {
15632
15670
  }
15633
15671
  };
15634
15672
 
15635
- // ../rivetkit/dist/tsup/chunk-AS47KFZD.js
15636
- function logger() {
15637
- return getLogger("actor-client");
15638
- }
15639
- var webSocketPromise = null;
15640
- async function importWebSocket() {
15641
- if (webSocketPromise !== null) {
15642
- return webSocketPromise;
15643
- }
15644
- webSocketPromise = (async () => {
15645
- let _WebSocket;
15646
- if (typeof WebSocket !== "undefined") {
15647
- _WebSocket = WebSocket;
15648
- } else {
15649
- try {
15650
- const moduleName = "ws";
15651
- const ws = await import(
15652
- /* webpackIgnore: true */
15653
- moduleName
15654
- );
15655
- _WebSocket = ws.default;
15656
- logger().debug("using websocket from npm");
15657
- } catch {
15658
- _WebSocket = class MockWebSocket {
15659
- constructor() {
15660
- throw new Error(
15661
- 'WebSocket support requires installing the "ws" peer dependency.'
15662
- );
15663
- }
15664
- };
15665
- logger().debug("using mock websocket");
15666
- }
15667
- }
15668
- return _WebSocket;
15669
- })();
15670
- return webSocketPromise;
15671
- }
15672
-
15673
- // ../rivetkit/dist/tsup/chunk-RZPPOGEQ.js
15673
+ // ../rivetkit/dist/tsup/chunk-B43X26WY.js
15674
15674
  var import_invariant2 = __toESM(require_invariant(), 1);
15675
15675
 
15676
15676
  // ../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
@@ -15848,7 +15848,7 @@ function createVersionedDataHandler(config3) {
15848
15848
  return new VersionedDataHandler(config3);
15849
15849
  }
15850
15850
 
15851
- // ../rivetkit/dist/tsup/chunk-RZPPOGEQ.js
15851
+ // ../rivetkit/dist/tsup/chunk-B43X26WY.js
15852
15852
  var import_invariant3 = __toESM(require_invariant(), 1);
15853
15853
  var import_invariant4 = __toESM(require_invariant(), 1);
15854
15854
  var PATH_CONNECT = "/connect";
@@ -18353,6 +18353,15 @@ function createQueueSender(senderOptions) {
18353
18353
  send
18354
18354
  };
18355
18355
  }
18356
+ async function prepareRetryableInit(init) {
18357
+ if (init.body instanceof ReadableStream) {
18358
+ return {
18359
+ ...init,
18360
+ body: new Uint8Array(await new Response(init.body).arrayBuffer())
18361
+ };
18362
+ }
18363
+ return init;
18364
+ }
18356
18365
  async function rawHttpFetch(driver, target, params, input, init, options = {}) {
18357
18366
  let path2;
18358
18367
  let originalUrl;
@@ -18887,9 +18896,10 @@ var ActorHandleRaw = class {
18887
18896
  return this.#fetchWithResolvedActor(input, init);
18888
18897
  }
18889
18898
  async #fetchWithResolvedActor(input, init) {
18890
- const { skipReadyWait, ...requestInit } = init ?? {};
18891
- const hasBody = requestInit.body !== void 0 ? requestInit.body !== null : isRequestLike(input) && input.body !== null;
18892
- const maxAttempts = hasBody ? 1 : this.#getDynamicQueryMaxAttempts();
18899
+ const { skipReadyWait, ...restInit } = init ?? {};
18900
+ const maxAttempts = this.#getDynamicQueryMaxAttempts();
18901
+ const requestInit = maxAttempts > 1 ? await prepareRetryableInit(restInit) : restInit;
18902
+ const clonesInputBody = requestInit.body === void 0 && isRequestLike(input) && input.body !== null;
18893
18903
  let useQueryTarget = isDynamicActorQuery(this.#actorResolutionState);
18894
18904
  const gatewayOptions = resolveActorGatewayOptions(
18895
18905
  this.#gatewayOptions,
@@ -18909,7 +18919,9 @@ var ActorHandleRaw = class {
18909
18919
  this.#driver,
18910
18920
  target,
18911
18921
  this.#params,
18912
- input,
18922
+ // Clone a body-bearing Request so retries don't reuse a consumed stream.
18923
+ // NOTE: This holds the body in memory until GC (unavoidable).
18924
+ clonesInputBody ? input.clone() : input,
18913
18925
  requestInit,
18914
18926
  gatewayOptions
18915
18927
  );
@@ -21620,7 +21632,7 @@ function apiActorToOutput(actor2) {
21620
21632
  };
21621
21633
  }
21622
21634
 
21623
- // ../rivetkit/dist/tsup/chunk-2EV7TJGB.js
21635
+ // ../rivetkit/dist/tsup/chunk-5NUTYSOA.js
21624
21636
  var nativeStateTransactionOpeners = /* @__PURE__ */ new WeakMap();
21625
21637
  var nativeStateTransactionClientBinders = /* @__PURE__ */ new WeakMap();
21626
21638
  function registerNativeStateTransactionOpener(provider, opener) {
package/dist/mod.mjs CHANGED
@@ -481,7 +481,7 @@ function unsupportedFeature(feature) {
481
481
  );
482
482
  }
483
483
 
484
- // ../rivetkit/dist/tsup/chunk-UZWKXBMV.js
484
+ // ../rivetkit/dist/tsup/chunk-WXKBI546.js
485
485
  import {
486
486
  pino,
487
487
  stdTimeFunctions
@@ -13157,7 +13157,7 @@ var classic_default = external_exports;
13157
13157
  // ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/index.js
13158
13158
  var v4_default = classic_default;
13159
13159
 
13160
- // ../rivetkit/dist/tsup/chunk-UZWKXBMV.js
13160
+ // ../rivetkit/dist/tsup/chunk-WXKBI546.js
13161
13161
  var import_invariant = __toESM(require_invariant(), 1);
13162
13162
  import * as cbor from "cbor-x";
13163
13163
  var getRivetEngine = () => getEnvUniversal("RIVET_ENGINE");
@@ -13331,7 +13331,7 @@ function noopNext() {
13331
13331
  }
13332
13332
  var package_default = {
13333
13333
  name: "rivetkit",
13334
- version: "2.3.13",
13334
+ version: "2.3.15-rc.1",
13335
13335
  description: "Lightweight libraries for building stateful actors on edge platforms",
13336
13336
  license: "Apache-2.0",
13337
13337
  keywords: [
@@ -13552,7 +13552,7 @@ var package_default = {
13552
13552
  "@rivetkit/virtual-websocket": "workspace:*",
13553
13553
  "@rivetkit/workflow-engine": "workspace:*",
13554
13554
  "cbor-x": "^1.6.0",
13555
- "drizzle-orm": "^0.44.2",
13555
+ "drizzle-orm": "catalog:",
13556
13556
  hono: "^4.7.0",
13557
13557
  invariant: "^2.2.4",
13558
13558
  "p-retry": "^6.2.1",
@@ -14635,7 +14635,7 @@ function Config({ initialBufferLength = 1024, maxBufferLength = 1024 * 1024 * 32
14635
14635
  };
14636
14636
  }
14637
14637
 
14638
- // ../rivetkit/dist/tsup/chunk-UQINOZ6M.js
14638
+ // ../rivetkit/dist/tsup/chunk-QEVBDSCG.js
14639
14639
  var config2 = /* @__PURE__ */ Config({});
14640
14640
  function readWorkflowCbor(bc) {
14641
14641
  return readData(bc);
@@ -15514,6 +15514,44 @@ function removePrefixFromKey(prefixedKey) {
15514
15514
  return prefixedKey.slice(KEYS.KV.length);
15515
15515
  }
15516
15516
 
15517
+ // ../rivetkit/dist/tsup/chunk-IMADANGF.js
15518
+ function logger() {
15519
+ return getLogger("actor-client");
15520
+ }
15521
+ var webSocketPromise = null;
15522
+ async function importWebSocket() {
15523
+ if (webSocketPromise !== null) {
15524
+ return webSocketPromise;
15525
+ }
15526
+ webSocketPromise = (async () => {
15527
+ let _WebSocket;
15528
+ if (typeof WebSocket !== "undefined") {
15529
+ _WebSocket = WebSocket;
15530
+ } else {
15531
+ try {
15532
+ const moduleName = "ws";
15533
+ const ws = await import(
15534
+ /* webpackIgnore: true */
15535
+ moduleName
15536
+ );
15537
+ _WebSocket = ws.default;
15538
+ logger().debug("using websocket from npm");
15539
+ } catch {
15540
+ _WebSocket = class MockWebSocket {
15541
+ constructor() {
15542
+ throw new Error(
15543
+ 'WebSocket support requires installing the "ws" peer dependency.'
15544
+ );
15545
+ }
15546
+ };
15547
+ logger().debug("using mock websocket");
15548
+ }
15549
+ }
15550
+ return _WebSocket;
15551
+ })();
15552
+ return webSocketPromise;
15553
+ }
15554
+
15517
15555
  // ../rivetkit/dist/tsup/chunk-JTHHCZCZ.js
15518
15556
  var MIGRATION_TRANSACTION_TIMEOUT_MS = 5 * 6e4;
15519
15557
  function isManualTransactionControl(query) {
@@ -15597,45 +15635,7 @@ var AsyncMutex = class {
15597
15635
  }
15598
15636
  };
15599
15637
 
15600
- // ../rivetkit/dist/tsup/chunk-AS47KFZD.js
15601
- function logger() {
15602
- return getLogger("actor-client");
15603
- }
15604
- var webSocketPromise = null;
15605
- async function importWebSocket() {
15606
- if (webSocketPromise !== null) {
15607
- return webSocketPromise;
15608
- }
15609
- webSocketPromise = (async () => {
15610
- let _WebSocket;
15611
- if (typeof WebSocket !== "undefined") {
15612
- _WebSocket = WebSocket;
15613
- } else {
15614
- try {
15615
- const moduleName = "ws";
15616
- const ws = await import(
15617
- /* webpackIgnore: true */
15618
- moduleName
15619
- );
15620
- _WebSocket = ws.default;
15621
- logger().debug("using websocket from npm");
15622
- } catch {
15623
- _WebSocket = class MockWebSocket {
15624
- constructor() {
15625
- throw new Error(
15626
- 'WebSocket support requires installing the "ws" peer dependency.'
15627
- );
15628
- }
15629
- };
15630
- logger().debug("using mock websocket");
15631
- }
15632
- }
15633
- return _WebSocket;
15634
- })();
15635
- return webSocketPromise;
15636
- }
15637
-
15638
- // ../rivetkit/dist/tsup/chunk-RZPPOGEQ.js
15638
+ // ../rivetkit/dist/tsup/chunk-B43X26WY.js
15639
15639
  var import_invariant2 = __toESM(require_invariant(), 1);
15640
15640
 
15641
15641
  // ../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
@@ -15813,7 +15813,7 @@ function createVersionedDataHandler(config3) {
15813
15813
  return new VersionedDataHandler(config3);
15814
15814
  }
15815
15815
 
15816
- // ../rivetkit/dist/tsup/chunk-RZPPOGEQ.js
15816
+ // ../rivetkit/dist/tsup/chunk-B43X26WY.js
15817
15817
  var import_invariant3 = __toESM(require_invariant(), 1);
15818
15818
  var import_invariant4 = __toESM(require_invariant(), 1);
15819
15819
  var PATH_CONNECT = "/connect";
@@ -18318,6 +18318,15 @@ function createQueueSender(senderOptions) {
18318
18318
  send
18319
18319
  };
18320
18320
  }
18321
+ async function prepareRetryableInit(init) {
18322
+ if (init.body instanceof ReadableStream) {
18323
+ return {
18324
+ ...init,
18325
+ body: new Uint8Array(await new Response(init.body).arrayBuffer())
18326
+ };
18327
+ }
18328
+ return init;
18329
+ }
18321
18330
  async function rawHttpFetch(driver, target, params, input, init, options = {}) {
18322
18331
  let path2;
18323
18332
  let originalUrl;
@@ -18852,9 +18861,10 @@ var ActorHandleRaw = class {
18852
18861
  return this.#fetchWithResolvedActor(input, init);
18853
18862
  }
18854
18863
  async #fetchWithResolvedActor(input, init) {
18855
- const { skipReadyWait, ...requestInit } = init ?? {};
18856
- const hasBody = requestInit.body !== void 0 ? requestInit.body !== null : isRequestLike(input) && input.body !== null;
18857
- const maxAttempts = hasBody ? 1 : this.#getDynamicQueryMaxAttempts();
18864
+ const { skipReadyWait, ...restInit } = init ?? {};
18865
+ const maxAttempts = this.#getDynamicQueryMaxAttempts();
18866
+ const requestInit = maxAttempts > 1 ? await prepareRetryableInit(restInit) : restInit;
18867
+ const clonesInputBody = requestInit.body === void 0 && isRequestLike(input) && input.body !== null;
18858
18868
  let useQueryTarget = isDynamicActorQuery(this.#actorResolutionState);
18859
18869
  const gatewayOptions = resolveActorGatewayOptions(
18860
18870
  this.#gatewayOptions,
@@ -18874,7 +18884,9 @@ var ActorHandleRaw = class {
18874
18884
  this.#driver,
18875
18885
  target,
18876
18886
  this.#params,
18877
- input,
18887
+ // Clone a body-bearing Request so retries don't reuse a consumed stream.
18888
+ // NOTE: This holds the body in memory until GC (unavoidable).
18889
+ clonesInputBody ? input.clone() : input,
18878
18890
  requestInit,
18879
18891
  gatewayOptions
18880
18892
  );
@@ -21585,7 +21597,7 @@ function apiActorToOutput(actor2) {
21585
21597
  };
21586
21598
  }
21587
21599
 
21588
- // ../rivetkit/dist/tsup/chunk-2EV7TJGB.js
21600
+ // ../rivetkit/dist/tsup/chunk-5NUTYSOA.js
21589
21601
  var nativeStateTransactionOpeners = /* @__PURE__ */ new WeakMap();
21590
21602
  var nativeStateTransactionClientBinders = /* @__PURE__ */ new WeakMap();
21591
21603
  function registerNativeStateTransactionOpener(provider, opener) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/supabase",
3
- "version": "2.3.13",
3
+ "version": "2.3.15-rc.1",
4
4
  "description": "Supabase Edge Functions integration for RivetKit actors",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -39,14 +39,14 @@
39
39
  "check-edge-closure": "node ../../../scripts/ci/check-edge-native-closure.mjs"
40
40
  },
41
41
  "dependencies": {
42
- "@rivetkit/rivetkit-wasm": "2.3.13",
42
+ "@rivetkit/rivetkit-wasm": "2.3.15-rc.1",
43
43
  "cbor-x": "^1.6.0",
44
44
  "pino": "^9.5.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@size-limit/file": "^11.1.6",
48
48
  "@types/node": "^22.0.0",
49
- "rivetkit": "2.3.13",
49
+ "rivetkit": "2.3.15-rc.1",
50
50
  "size-limit": "^11.1.6",
51
51
  "tsup": "^8.4.0",
52
52
  "typescript": "^5.5.2"