@rivetkit/supabase 2.3.23 → 2.3.24

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 +69 -50
  2. package/dist/mod.mjs +69 -50
  3. package/package.json +3 -3
package/dist/mod.js CHANGED
@@ -538,7 +538,7 @@ function unsupportedFeature(feature) {
538
538
  );
539
539
  }
540
540
 
541
- // ../rivetkit/dist/tsup/chunk-674WU4L6.js
541
+ // ../rivetkit/dist/tsup/chunk-YH2CAWLD.js
542
542
  var import_pino = require("pino");
543
543
 
544
544
  // ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/external.js
@@ -13211,7 +13211,7 @@ var classic_default = external_exports;
13211
13211
  // ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/index.js
13212
13212
  var v4_default = classic_default;
13213
13213
 
13214
- // ../rivetkit/dist/tsup/chunk-674WU4L6.js
13214
+ // ../rivetkit/dist/tsup/chunk-YH2CAWLD.js
13215
13215
  var cbor = __toESM(require("cbor-x"), 1);
13216
13216
  var import_invariant = __toESM(require_invariant(), 1);
13217
13217
  var getRivetEngine = () => getEnvUniversal("RIVET_ENGINE");
@@ -13382,7 +13382,7 @@ function noopNext() {
13382
13382
  }
13383
13383
  var package_default = {
13384
13384
  name: "rivetkit",
13385
- version: "2.3.23",
13385
+ version: "2.3.24",
13386
13386
  description: "Lightweight libraries for building stateful actors on edge platforms",
13387
13387
  license: "Apache-2.0",
13388
13388
  keywords: [
@@ -14689,7 +14689,7 @@ function Config({ initialBufferLength = 1024, maxBufferLength = 1024 * 1024 * 32
14689
14689
  };
14690
14690
  }
14691
14691
 
14692
- // ../rivetkit/dist/tsup/chunk-Z3Z5EOSP.js
14692
+ // ../rivetkit/dist/tsup/chunk-QMR2J7PT.js
14693
14693
  var config2 = /* @__PURE__ */ Config({});
14694
14694
  function readWorkflowCbor(bc) {
14695
14695
  return readData(bc);
@@ -15599,6 +15599,44 @@ function removePrefixFromKey(prefixedKey) {
15599
15599
  return prefixedKey.slice(KEYS.KV.length);
15600
15600
  }
15601
15601
 
15602
+ // ../rivetkit/dist/tsup/chunk-NSNBWLCG.js
15603
+ function logger() {
15604
+ return getLogger("actor-client");
15605
+ }
15606
+ var webSocketPromise = null;
15607
+ async function importWebSocket() {
15608
+ if (webSocketPromise !== null) {
15609
+ return webSocketPromise;
15610
+ }
15611
+ webSocketPromise = (async () => {
15612
+ let _WebSocket;
15613
+ if (typeof WebSocket !== "undefined") {
15614
+ _WebSocket = WebSocket;
15615
+ } else {
15616
+ try {
15617
+ const moduleName = "ws";
15618
+ const ws = await import(
15619
+ /* webpackIgnore: true */
15620
+ moduleName
15621
+ );
15622
+ _WebSocket = ws.default;
15623
+ logger().debug("using websocket from npm");
15624
+ } catch {
15625
+ _WebSocket = class MockWebSocket {
15626
+ constructor() {
15627
+ throw new Error(
15628
+ 'WebSocket support requires installing the "ws" peer dependency.'
15629
+ );
15630
+ }
15631
+ };
15632
+ logger().debug("using mock websocket");
15633
+ }
15634
+ }
15635
+ return _WebSocket;
15636
+ })();
15637
+ return webSocketPromise;
15638
+ }
15639
+
15602
15640
  // ../rivetkit/dist/tsup/chunk-JTHHCZCZ.js
15603
15641
  var MIGRATION_TRANSACTION_TIMEOUT_MS = 5 * 6e4;
15604
15642
  function isManualTransactionControl(query) {
@@ -15682,45 +15720,7 @@ var AsyncMutex = class {
15682
15720
  }
15683
15721
  };
15684
15722
 
15685
- // ../rivetkit/dist/tsup/chunk-KC3T3MMB.js
15686
- function logger() {
15687
- return getLogger("actor-client");
15688
- }
15689
- var webSocketPromise = null;
15690
- async function importWebSocket() {
15691
- if (webSocketPromise !== null) {
15692
- return webSocketPromise;
15693
- }
15694
- webSocketPromise = (async () => {
15695
- let _WebSocket;
15696
- if (typeof WebSocket !== "undefined") {
15697
- _WebSocket = WebSocket;
15698
- } else {
15699
- try {
15700
- const moduleName = "ws";
15701
- const ws = await import(
15702
- /* webpackIgnore: true */
15703
- moduleName
15704
- );
15705
- _WebSocket = ws.default;
15706
- logger().debug("using websocket from npm");
15707
- } catch {
15708
- _WebSocket = class MockWebSocket {
15709
- constructor() {
15710
- throw new Error(
15711
- 'WebSocket support requires installing the "ws" peer dependency.'
15712
- );
15713
- }
15714
- };
15715
- logger().debug("using mock websocket");
15716
- }
15717
- }
15718
- return _WebSocket;
15719
- })();
15720
- return webSocketPromise;
15721
- }
15722
-
15723
- // ../rivetkit/dist/tsup/chunk-LKNGMRIT.js
15723
+ // ../rivetkit/dist/tsup/chunk-SW22GCYF.js
15724
15724
  var import_invariant2 = __toESM(require_invariant(), 1);
15725
15725
 
15726
15726
  // ../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
@@ -16935,7 +16935,7 @@ var TraceAPI = (
16935
16935
  // ../../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace-api.js
16936
16936
  var trace = TraceAPI.getInstance();
16937
16937
 
16938
- // ../rivetkit/dist/tsup/chunk-LKNGMRIT.js
16938
+ // ../rivetkit/dist/tsup/chunk-SW22GCYF.js
16939
16939
  var import_invariant3 = __toESM(require_invariant(), 1);
16940
16940
  var import_invariant4 = __toESM(require_invariant(), 1);
16941
16941
  var PATH_CONNECT = "/connect";
@@ -19018,6 +19018,14 @@ function isResponseLike(value) {
19018
19018
  function isHeadersLike(value) {
19019
19019
  return typeof value === "object" && value !== null && typeof value.entries === "function";
19020
19020
  }
19021
+ function readRequestBody(request) {
19022
+ if (!request.body) return request.arrayBuffer();
19023
+ return new Response(
19024
+ request.body.pipeThrough(new TransformStream(), {
19025
+ signal: request.signal
19026
+ })
19027
+ ).arrayBuffer();
19028
+ }
19021
19029
  function* walkErrorChain(error46, maxDepth = 8) {
19022
19030
  let current = error46;
19023
19031
  let depth = 0;
@@ -19546,9 +19554,10 @@ async function rawHttpFetch(driver, target, params, input, init, options = {}, t
19546
19554
  initHeaders.forEach((value, key) => {
19547
19555
  mergedHeaders.set(key, value);
19548
19556
  });
19557
+ const readsInputBody = (init == null ? void 0 : init.body) === void 0 && input.method !== "GET" && input.method !== "HEAD";
19549
19558
  mergedInit = {
19550
19559
  method: input.method,
19551
- body: input.body,
19560
+ body: readsInputBody ? await readRequestBody(input) : void 0,
19552
19561
  mode: input.mode,
19553
19562
  credentials: input.credentials,
19554
19563
  redirect: input.redirect,
@@ -21967,6 +21976,8 @@ var ClientConfigSchemaBase = v4_default.object({
21967
21976
  // This is required in the client config in order to support
21968
21977
  // `proxyWebSocket`
21969
21978
  getUpgradeWebSocket: v4_default.custom().optional(),
21979
+ /** Replaces global fetch for actor HTTP gateway requests. */
21980
+ fetch: v4_default.custom().optional(),
21970
21981
  /** Whether to automatically perform health checks when the client is created. */
21971
21982
  disableMetadataLookup: v4_default.boolean().optional().default(false),
21972
21983
  /**
@@ -22028,18 +22039,26 @@ async function sendHttpRequestToGateway(runConfig, gatewayUrl, actorRequest, opt
22028
22039
  if (actorRequest.bodyUsed) {
22029
22040
  throw new Error("Request body has already been consumed");
22030
22041
  }
22031
- if (actorRequest.body) {
22032
- bodyToSend = actorRequest.body;
22042
+ const bytes = await readRequestBody(actorRequest);
22043
+ if (bytes.byteLength > 0) {
22044
+ bodyToSend = bytes;
22033
22045
  guardHeaders.delete("transfer-encoding");
22034
22046
  guardHeaders.delete("content-length");
22035
22047
  }
22036
22048
  }
22037
- return fetch(gatewayUrl, {
22049
+ const fetchImpl = runConfig.fetch ?? fetch;
22050
+ return fetchImpl(gatewayUrl, {
22038
22051
  method: actorRequest.method,
22039
22052
  headers: guardHeaders,
22040
22053
  body: bodyToSend,
22041
22054
  signal: actorRequest.signal,
22042
- ...bodyToSend ? { duplex: "half" } : {}
22055
+ mode: actorRequest.mode,
22056
+ credentials: actorRequest.credentials,
22057
+ redirect: actorRequest.redirect,
22058
+ referrer: actorRequest.referrer,
22059
+ referrerPolicy: actorRequest.referrerPolicy,
22060
+ integrity: actorRequest.integrity,
22061
+ keepalive: actorRequest.keepalive
22043
22062
  });
22044
22063
  }
22045
22064
  function buildGuardHeaders(runConfig, actorRequest, options) {
@@ -23112,7 +23131,7 @@ function apiActorToOutput(actor2) {
23112
23131
  };
23113
23132
  }
23114
23133
 
23115
- // ../rivetkit/dist/tsup/chunk-HO6UA2RJ.js
23134
+ // ../rivetkit/dist/tsup/chunk-QZQE75U2.js
23116
23135
  var nativeStateTransactionOpeners = /* @__PURE__ */ new WeakMap();
23117
23136
  var nativeStateTransactionClientBinders = /* @__PURE__ */ new WeakMap();
23118
23137
  function registerNativeStateTransactionOpener(provider, opener) {
package/dist/mod.mjs CHANGED
@@ -500,7 +500,7 @@ function unsupportedFeature(feature) {
500
500
  );
501
501
  }
502
502
 
503
- // ../rivetkit/dist/tsup/chunk-674WU4L6.js
503
+ // ../rivetkit/dist/tsup/chunk-YH2CAWLD.js
504
504
  import {
505
505
  pino,
506
506
  stdTimeFunctions
@@ -13176,7 +13176,7 @@ var classic_default = external_exports;
13176
13176
  // ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/index.js
13177
13177
  var v4_default = classic_default;
13178
13178
 
13179
- // ../rivetkit/dist/tsup/chunk-674WU4L6.js
13179
+ // ../rivetkit/dist/tsup/chunk-YH2CAWLD.js
13180
13180
  var import_invariant = __toESM(require_invariant(), 1);
13181
13181
  import * as cbor from "cbor-x";
13182
13182
  var getRivetEngine = () => getEnvUniversal("RIVET_ENGINE");
@@ -13347,7 +13347,7 @@ function noopNext() {
13347
13347
  }
13348
13348
  var package_default = {
13349
13349
  name: "rivetkit",
13350
- version: "2.3.23",
13350
+ version: "2.3.24",
13351
13351
  description: "Lightweight libraries for building stateful actors on edge platforms",
13352
13352
  license: "Apache-2.0",
13353
13353
  keywords: [
@@ -14654,7 +14654,7 @@ function Config({ initialBufferLength = 1024, maxBufferLength = 1024 * 1024 * 32
14654
14654
  };
14655
14655
  }
14656
14656
 
14657
- // ../rivetkit/dist/tsup/chunk-Z3Z5EOSP.js
14657
+ // ../rivetkit/dist/tsup/chunk-QMR2J7PT.js
14658
14658
  var config2 = /* @__PURE__ */ Config({});
14659
14659
  function readWorkflowCbor(bc) {
14660
14660
  return readData(bc);
@@ -15564,6 +15564,44 @@ function removePrefixFromKey(prefixedKey) {
15564
15564
  return prefixedKey.slice(KEYS.KV.length);
15565
15565
  }
15566
15566
 
15567
+ // ../rivetkit/dist/tsup/chunk-NSNBWLCG.js
15568
+ function logger() {
15569
+ return getLogger("actor-client");
15570
+ }
15571
+ var webSocketPromise = null;
15572
+ async function importWebSocket() {
15573
+ if (webSocketPromise !== null) {
15574
+ return webSocketPromise;
15575
+ }
15576
+ webSocketPromise = (async () => {
15577
+ let _WebSocket;
15578
+ if (typeof WebSocket !== "undefined") {
15579
+ _WebSocket = WebSocket;
15580
+ } else {
15581
+ try {
15582
+ const moduleName = "ws";
15583
+ const ws = await import(
15584
+ /* webpackIgnore: true */
15585
+ moduleName
15586
+ );
15587
+ _WebSocket = ws.default;
15588
+ logger().debug("using websocket from npm");
15589
+ } catch {
15590
+ _WebSocket = class MockWebSocket {
15591
+ constructor() {
15592
+ throw new Error(
15593
+ 'WebSocket support requires installing the "ws" peer dependency.'
15594
+ );
15595
+ }
15596
+ };
15597
+ logger().debug("using mock websocket");
15598
+ }
15599
+ }
15600
+ return _WebSocket;
15601
+ })();
15602
+ return webSocketPromise;
15603
+ }
15604
+
15567
15605
  // ../rivetkit/dist/tsup/chunk-JTHHCZCZ.js
15568
15606
  var MIGRATION_TRANSACTION_TIMEOUT_MS = 5 * 6e4;
15569
15607
  function isManualTransactionControl(query) {
@@ -15647,45 +15685,7 @@ var AsyncMutex = class {
15647
15685
  }
15648
15686
  };
15649
15687
 
15650
- // ../rivetkit/dist/tsup/chunk-KC3T3MMB.js
15651
- function logger() {
15652
- return getLogger("actor-client");
15653
- }
15654
- var webSocketPromise = null;
15655
- async function importWebSocket() {
15656
- if (webSocketPromise !== null) {
15657
- return webSocketPromise;
15658
- }
15659
- webSocketPromise = (async () => {
15660
- let _WebSocket;
15661
- if (typeof WebSocket !== "undefined") {
15662
- _WebSocket = WebSocket;
15663
- } else {
15664
- try {
15665
- const moduleName = "ws";
15666
- const ws = await import(
15667
- /* webpackIgnore: true */
15668
- moduleName
15669
- );
15670
- _WebSocket = ws.default;
15671
- logger().debug("using websocket from npm");
15672
- } catch {
15673
- _WebSocket = class MockWebSocket {
15674
- constructor() {
15675
- throw new Error(
15676
- 'WebSocket support requires installing the "ws" peer dependency.'
15677
- );
15678
- }
15679
- };
15680
- logger().debug("using mock websocket");
15681
- }
15682
- }
15683
- return _WebSocket;
15684
- })();
15685
- return webSocketPromise;
15686
- }
15687
-
15688
- // ../rivetkit/dist/tsup/chunk-LKNGMRIT.js
15688
+ // ../rivetkit/dist/tsup/chunk-SW22GCYF.js
15689
15689
  var import_invariant2 = __toESM(require_invariant(), 1);
15690
15690
 
15691
15691
  // ../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
@@ -16900,7 +16900,7 @@ var TraceAPI = (
16900
16900
  // ../../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace-api.js
16901
16901
  var trace = TraceAPI.getInstance();
16902
16902
 
16903
- // ../rivetkit/dist/tsup/chunk-LKNGMRIT.js
16903
+ // ../rivetkit/dist/tsup/chunk-SW22GCYF.js
16904
16904
  var import_invariant3 = __toESM(require_invariant(), 1);
16905
16905
  var import_invariant4 = __toESM(require_invariant(), 1);
16906
16906
  var PATH_CONNECT = "/connect";
@@ -18983,6 +18983,14 @@ function isResponseLike(value) {
18983
18983
  function isHeadersLike(value) {
18984
18984
  return typeof value === "object" && value !== null && typeof value.entries === "function";
18985
18985
  }
18986
+ function readRequestBody(request) {
18987
+ if (!request.body) return request.arrayBuffer();
18988
+ return new Response(
18989
+ request.body.pipeThrough(new TransformStream(), {
18990
+ signal: request.signal
18991
+ })
18992
+ ).arrayBuffer();
18993
+ }
18986
18994
  function* walkErrorChain(error46, maxDepth = 8) {
18987
18995
  let current = error46;
18988
18996
  let depth = 0;
@@ -19511,9 +19519,10 @@ async function rawHttpFetch(driver, target, params, input, init, options = {}, t
19511
19519
  initHeaders.forEach((value, key) => {
19512
19520
  mergedHeaders.set(key, value);
19513
19521
  });
19522
+ const readsInputBody = (init == null ? void 0 : init.body) === void 0 && input.method !== "GET" && input.method !== "HEAD";
19514
19523
  mergedInit = {
19515
19524
  method: input.method,
19516
- body: input.body,
19525
+ body: readsInputBody ? await readRequestBody(input) : void 0,
19517
19526
  mode: input.mode,
19518
19527
  credentials: input.credentials,
19519
19528
  redirect: input.redirect,
@@ -21932,6 +21941,8 @@ var ClientConfigSchemaBase = v4_default.object({
21932
21941
  // This is required in the client config in order to support
21933
21942
  // `proxyWebSocket`
21934
21943
  getUpgradeWebSocket: v4_default.custom().optional(),
21944
+ /** Replaces global fetch for actor HTTP gateway requests. */
21945
+ fetch: v4_default.custom().optional(),
21935
21946
  /** Whether to automatically perform health checks when the client is created. */
21936
21947
  disableMetadataLookup: v4_default.boolean().optional().default(false),
21937
21948
  /**
@@ -21993,18 +22004,26 @@ async function sendHttpRequestToGateway(runConfig, gatewayUrl, actorRequest, opt
21993
22004
  if (actorRequest.bodyUsed) {
21994
22005
  throw new Error("Request body has already been consumed");
21995
22006
  }
21996
- if (actorRequest.body) {
21997
- bodyToSend = actorRequest.body;
22007
+ const bytes = await readRequestBody(actorRequest);
22008
+ if (bytes.byteLength > 0) {
22009
+ bodyToSend = bytes;
21998
22010
  guardHeaders.delete("transfer-encoding");
21999
22011
  guardHeaders.delete("content-length");
22000
22012
  }
22001
22013
  }
22002
- return fetch(gatewayUrl, {
22014
+ const fetchImpl = runConfig.fetch ?? fetch;
22015
+ return fetchImpl(gatewayUrl, {
22003
22016
  method: actorRequest.method,
22004
22017
  headers: guardHeaders,
22005
22018
  body: bodyToSend,
22006
22019
  signal: actorRequest.signal,
22007
- ...bodyToSend ? { duplex: "half" } : {}
22020
+ mode: actorRequest.mode,
22021
+ credentials: actorRequest.credentials,
22022
+ redirect: actorRequest.redirect,
22023
+ referrer: actorRequest.referrer,
22024
+ referrerPolicy: actorRequest.referrerPolicy,
22025
+ integrity: actorRequest.integrity,
22026
+ keepalive: actorRequest.keepalive
22008
22027
  });
22009
22028
  }
22010
22029
  function buildGuardHeaders(runConfig, actorRequest, options) {
@@ -23077,7 +23096,7 @@ function apiActorToOutput(actor2) {
23077
23096
  };
23078
23097
  }
23079
23098
 
23080
- // ../rivetkit/dist/tsup/chunk-HO6UA2RJ.js
23099
+ // ../rivetkit/dist/tsup/chunk-QZQE75U2.js
23081
23100
  var nativeStateTransactionOpeners = /* @__PURE__ */ new WeakMap();
23082
23101
  var nativeStateTransactionClientBinders = /* @__PURE__ */ new WeakMap();
23083
23102
  function registerNativeStateTransactionOpener(provider, opener) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/supabase",
3
- "version": "2.3.23",
3
+ "version": "2.3.24",
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.23",
42
+ "@rivetkit/rivetkit-wasm": "2.3.24",
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.23",
49
+ "rivetkit": "2.3.24",
50
50
  "size-limit": "^11.1.6",
51
51
  "tsup": "^8.4.0",
52
52
  "typescript": "^5.5.2"