rivetkit 2.0.29-rc.1 → 2.0.30
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/dist/tsup/{chunk-J74MGKP5.cjs → chunk-23EJLAOV.cjs} +6 -6
- package/dist/tsup/{chunk-J74MGKP5.cjs.map → chunk-23EJLAOV.cjs.map} +1 -1
- package/dist/tsup/{chunk-J3M5ATO5.cjs → chunk-3WG6PXWE.cjs} +3 -3
- package/dist/tsup/{chunk-J3M5ATO5.cjs.map → chunk-3WG6PXWE.cjs.map} +1 -1
- package/dist/tsup/{chunk-IRGPMCKQ.cjs → chunk-46DWBVYE.cjs} +15 -15
- package/dist/tsup/{chunk-IRGPMCKQ.cjs.map → chunk-46DWBVYE.cjs.map} +1 -1
- package/dist/tsup/{chunk-CGIRSKRW.js → chunk-DGSYEC34.js} +3 -3
- package/dist/tsup/{chunk-QT7PPLSB.cjs → chunk-DI7LJEYL.cjs} +6 -6
- package/dist/tsup/chunk-DI7LJEYL.cjs.map +1 -0
- package/dist/tsup/{chunk-5RN6O2RW.js → chunk-DQH5K5TL.js} +3 -3
- package/dist/tsup/chunk-DQH5K5TL.js.map +1 -0
- package/dist/tsup/{chunk-WUFUT7CZ.js → chunk-EOXUA7SX.js} +2 -2
- package/dist/tsup/{chunk-SE37OCA2.cjs → chunk-F4CRQFYG.cjs} +17 -17
- package/dist/tsup/{chunk-SE37OCA2.cjs.map → chunk-F4CRQFYG.cjs.map} +1 -1
- package/dist/tsup/{chunk-2Q6FJITJ.cjs → chunk-FVSTM7QK.cjs} +3 -3
- package/dist/tsup/{chunk-2Q6FJITJ.cjs.map → chunk-FVSTM7QK.cjs.map} +1 -1
- package/dist/tsup/{chunk-QKDCNAPW.js → chunk-GOC4GSPT.js} +7 -7
- package/dist/tsup/chunk-GOC4GSPT.js.map +1 -0
- package/dist/tsup/{chunk-HXWPIIEM.js → chunk-HPIRVETT.js} +2 -2
- package/dist/tsup/{chunk-EU7VV5PU.js → chunk-K2UD42XA.js} +2 -2
- package/dist/tsup/{chunk-BAEMOCS7.cjs → chunk-NYQJHQHK.cjs} +169 -169
- package/dist/tsup/chunk-NYQJHQHK.cjs.map +1 -0
- package/dist/tsup/{chunk-YJXB7BPR.js → chunk-OI6FEIRD.js} +2 -2
- package/dist/tsup/chunk-OI6FEIRD.js.map +1 -0
- package/dist/tsup/{chunk-AJ36VBHL.cjs → chunk-REMOXAIW.cjs} +2 -2
- package/dist/tsup/chunk-REMOXAIW.cjs.map +1 -0
- package/dist/tsup/{chunk-EVQJYFFP.js → chunk-SLAUR4QB.js} +2 -2
- package/dist/tsup/{chunk-XVBIJET6.cjs → chunk-VROCBPWT.cjs} +10 -10
- package/dist/tsup/{chunk-XVBIJET6.cjs.map → chunk-VROCBPWT.cjs.map} +1 -1
- package/dist/tsup/{chunk-CHPLLKNL.js → chunk-YBOQOQZB.js} +71 -6
- package/dist/tsup/chunk-YBOQOQZB.js.map +1 -0
- package/dist/tsup/{chunk-SDJFBUFE.js → chunk-Z33UBLLH.js} +7 -7
- package/dist/tsup/{chunk-MG2TWYPF.cjs → chunk-ZUJRXXQC.cjs} +260 -195
- package/dist/tsup/chunk-ZUJRXXQC.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +8 -8
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +7 -7
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-CcMdKDv9.d.ts → config-Cs3B9xN9.d.ts} +32 -1
- package/dist/tsup/{config-DxlmiJS1.d.cts → config-Dj5nTCrh.d.cts} +32 -1
- package/dist/tsup/driver-helpers/mod.cjs +4 -4
- package/dist/tsup/driver-helpers/mod.d.cts +1 -1
- package/dist/tsup/driver-helpers/mod.d.ts +1 -1
- package/dist/tsup/driver-helpers/mod.js +3 -3
- package/dist/tsup/driver-test-suite/mod.cjs +189 -71
- package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
- package/dist/tsup/driver-test-suite/mod.d.cts +1 -1
- package/dist/tsup/driver-test-suite/mod.d.ts +1 -1
- package/dist/tsup/driver-test-suite/mod.js +128 -10
- package/dist/tsup/driver-test-suite/mod.js.map +1 -1
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.d.cts +2 -2
- package/dist/tsup/inspector/mod.d.ts +2 -2
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/mod.cjs +9 -9
- package/dist/tsup/mod.d.cts +2 -2
- package/dist/tsup/mod.d.ts +2 -2
- package/dist/tsup/mod.js +8 -8
- package/dist/tsup/test/mod.cjs +11 -11
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +10 -10
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/package.json +2 -2
- package/src/actor/mod.ts +2 -0
- package/src/client/actor-conn.ts +87 -0
- package/src/client/mod.ts +5 -1
- package/src/driver-test-suite/tests/actor-conn.ts +199 -0
- package/dist/tsup/chunk-5RN6O2RW.js.map +0 -1
- package/dist/tsup/chunk-AJ36VBHL.cjs.map +0 -1
- package/dist/tsup/chunk-BAEMOCS7.cjs.map +0 -1
- package/dist/tsup/chunk-CHPLLKNL.js.map +0 -1
- package/dist/tsup/chunk-MG2TWYPF.cjs.map +0 -1
- package/dist/tsup/chunk-QKDCNAPW.js.map +0 -1
- package/dist/tsup/chunk-QT7PPLSB.cjs.map +0 -1
- package/dist/tsup/chunk-YJXB7BPR.js.map +0 -1
- /package/dist/tsup/{chunk-CGIRSKRW.js.map → chunk-DGSYEC34.js.map} +0 -0
- /package/dist/tsup/{chunk-WUFUT7CZ.js.map → chunk-EOXUA7SX.js.map} +0 -0
- /package/dist/tsup/{chunk-HXWPIIEM.js.map → chunk-HPIRVETT.js.map} +0 -0
- /package/dist/tsup/{chunk-EU7VV5PU.js.map → chunk-K2UD42XA.js.map} +0 -0
- /package/dist/tsup/{chunk-EVQJYFFP.js.map → chunk-SLAUR4QB.js.map} +0 -0
- /package/dist/tsup/{chunk-SDJFBUFE.js.map → chunk-Z33UBLLH.js.map} +0 -0
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk46DWBVYEcjs = require('../chunk-46DWBVYE.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkNYQJHQHKcjs = require('../chunk-NYQJHQHK.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk3WG6PXWEcjs = require('../chunk-3WG6PXWE.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkDI7LJEYLcjs = require('../chunk-DI7LJEYL.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
20
|
-
require('../chunk-
|
|
19
|
+
var _chunkZUJRXXQCcjs = require('../chunk-ZUJRXXQC.cjs');
|
|
20
|
+
require('../chunk-VROCBPWT.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkFVSTM7QKcjs = require('../chunk-FVSTM7QK.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkF4CRQFYGcjs = require('../chunk-F4CRQFYG.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
@@ -35,11 +35,11 @@ var _chunkSE37OCA2cjs = require('../chunk-SE37OCA2.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunk23EJLAOVcjs = require('../chunk-23EJLAOV.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkREMOXAIWcjs = require('../chunk-REMOXAIW.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
@@ -53,7 +53,7 @@ var _vitest = require('vitest');
|
|
|
53
53
|
|
|
54
54
|
// src/driver-test-suite/log.ts
|
|
55
55
|
function logger() {
|
|
56
|
-
return
|
|
56
|
+
return _chunkREMOXAIWcjs.getLogger.call(void 0, "test-suite");
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
// src/driver-test-suite/tests/action-features.ts
|
|
@@ -103,7 +103,7 @@ function createTestInlineClientDriver(endpoint, encoding) {
|
|
|
103
103
|
to: url
|
|
104
104
|
});
|
|
105
105
|
const headers = new Headers(actorRequest.headers);
|
|
106
|
-
headers.set(
|
|
106
|
+
headers.set(_chunk23EJLAOVcjs.HEADER_ACTOR_ID, actorId);
|
|
107
107
|
const response = await fetch(
|
|
108
108
|
new Request(url, {
|
|
109
109
|
method: actorRequest.method,
|
|
@@ -119,7 +119,7 @@ function createTestInlineClientDriver(endpoint, encoding) {
|
|
|
119
119
|
const errorData = await clonedResponse.json();
|
|
120
120
|
if (errorData.error) {
|
|
121
121
|
if (typeof errorData.error === "object") {
|
|
122
|
-
throw new (0,
|
|
122
|
+
throw new (0, _chunkZUJRXXQCcjs.ActorError)(
|
|
123
123
|
errorData.error.code,
|
|
124
124
|
errorData.error.message,
|
|
125
125
|
errorData.error.metadata
|
|
@@ -127,7 +127,7 @@ function createTestInlineClientDriver(endpoint, encoding) {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
} catch (e) {
|
|
130
|
-
if (!(e instanceof
|
|
130
|
+
if (!(e instanceof _chunkZUJRXXQCcjs.ActorError)) {
|
|
131
131
|
return response;
|
|
132
132
|
}
|
|
133
133
|
throw e;
|
|
@@ -136,7 +136,7 @@ function createTestInlineClientDriver(endpoint, encoding) {
|
|
|
136
136
|
return response;
|
|
137
137
|
},
|
|
138
138
|
async openWebSocket(path, actorId, encoding2, params) {
|
|
139
|
-
const WebSocket2 = await
|
|
139
|
+
const WebSocket2 = await _chunkFVSTM7QKcjs.importWebSocket.call(void 0, );
|
|
140
140
|
const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
|
|
141
141
|
const wsUrl = new URL(
|
|
142
142
|
`${endpoint}/.test/inline-driver/connect-websocket/ws`
|
|
@@ -148,18 +148,18 @@ function createTestInlineClientDriver(endpoint, encoding) {
|
|
|
148
148
|
const wsProtocol = wsUrl.protocol === "https:" ? "wss:" : "ws:";
|
|
149
149
|
const finalWsUrl = `${wsProtocol}//${wsUrl.host}${wsUrl.pathname}`;
|
|
150
150
|
const protocols = [];
|
|
151
|
-
protocols.push(
|
|
152
|
-
protocols.push(`${
|
|
151
|
+
protocols.push(_chunk23EJLAOVcjs.WS_PROTOCOL_STANDARD);
|
|
152
|
+
protocols.push(`${_chunk23EJLAOVcjs.WS_PROTOCOL_TARGET}actor`);
|
|
153
153
|
protocols.push(
|
|
154
|
-
`${
|
|
154
|
+
`${_chunk23EJLAOVcjs.WS_PROTOCOL_ACTOR}${encodeURIComponent(actorId)}`
|
|
155
155
|
);
|
|
156
|
-
protocols.push(`${
|
|
156
|
+
protocols.push(`${_chunk23EJLAOVcjs.WS_PROTOCOL_ENCODING}${encoding2}`);
|
|
157
157
|
protocols.push(
|
|
158
|
-
`${
|
|
158
|
+
`${_chunk23EJLAOVcjs.WS_TEST_PROTOCOL_PATH}${encodeURIComponent(normalizedPath)}`
|
|
159
159
|
);
|
|
160
160
|
if (params !== void 0) {
|
|
161
161
|
protocols.push(
|
|
162
|
-
`${
|
|
162
|
+
`${_chunk23EJLAOVcjs.WS_PROTOCOL_CONN_PARAMS}${encodeURIComponent(JSON.stringify(params))}`
|
|
163
163
|
);
|
|
164
164
|
}
|
|
165
165
|
logger().debug({
|
|
@@ -525,14 +525,14 @@ async function makeInlineRequest(endpoint, encoding, method, args) {
|
|
|
525
525
|
if ("ok" in callResponse) {
|
|
526
526
|
return callResponse.ok;
|
|
527
527
|
} else if ("err" in callResponse) {
|
|
528
|
-
throw new (0,
|
|
528
|
+
throw new (0, _chunkZUJRXXQCcjs.ActorError)(
|
|
529
529
|
callResponse.err.group,
|
|
530
530
|
callResponse.err.code,
|
|
531
531
|
callResponse.err.message,
|
|
532
532
|
callResponse.err.metadata
|
|
533
533
|
);
|
|
534
534
|
} else {
|
|
535
|
-
|
|
535
|
+
_chunk23EJLAOVcjs.assertUnreachable.call(void 0, callResponse);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
|
|
@@ -550,7 +550,7 @@ async function setupDriverTest(c, driverTestConfig) {
|
|
|
550
550
|
});
|
|
551
551
|
let client;
|
|
552
552
|
if (driverTestConfig.clientType === "http") {
|
|
553
|
-
client =
|
|
553
|
+
client = _chunkDI7LJEYLcjs.createClient.call(void 0, {
|
|
554
554
|
endpoint,
|
|
555
555
|
namespace,
|
|
556
556
|
runnerName,
|
|
@@ -559,12 +559,12 @@ async function setupDriverTest(c, driverTestConfig) {
|
|
|
559
559
|
} else if (driverTestConfig.clientType === "inline") {
|
|
560
560
|
const encoding = _nullishCoalesce(driverTestConfig.encoding, () => ( "bare"));
|
|
561
561
|
const managerDriver = createTestInlineClientDriver(endpoint, encoding);
|
|
562
|
-
const runConfig =
|
|
562
|
+
const runConfig = _chunkF4CRQFYGcjs.RunnerConfigSchema.parse({
|
|
563
563
|
encoding
|
|
564
564
|
});
|
|
565
|
-
client =
|
|
565
|
+
client = _chunkZUJRXXQCcjs.createClientWithDriver.call(void 0, managerDriver, runConfig);
|
|
566
566
|
} else {
|
|
567
|
-
|
|
567
|
+
_chunk23EJLAOVcjs.assertUnreachable.call(void 0, driverTestConfig.clientType);
|
|
568
568
|
}
|
|
569
569
|
if (!driverTestConfig.HACK_skipCleanupNet) {
|
|
570
570
|
c.onTestFinished(async () => await client.dispose());
|
|
@@ -864,6 +864,124 @@ function runActorConnTests(driverTestConfig) {
|
|
|
864
864
|
);
|
|
865
865
|
});
|
|
866
866
|
});
|
|
867
|
+
_vitest.describe.call(void 0, "Connection State", () => {
|
|
868
|
+
_vitest.test.call(void 0, "isConnected should be false before connection opens", async (c) => {
|
|
869
|
+
const { client } = await setupDriverTest(c, driverTestConfig);
|
|
870
|
+
const handle = client.counter.getOrCreate([
|
|
871
|
+
"test-isconnected-initial"
|
|
872
|
+
]);
|
|
873
|
+
const connection = handle.connect();
|
|
874
|
+
_vitest.expect.call(void 0, connection.isConnected).toBe(false);
|
|
875
|
+
await _vitest.vi.waitFor(() => {
|
|
876
|
+
_vitest.expect.call(void 0, connection.isConnected).toBe(true);
|
|
877
|
+
});
|
|
878
|
+
await connection.dispose();
|
|
879
|
+
});
|
|
880
|
+
_vitest.test.call(void 0, "onOpen should be called when connection opens", async (c) => {
|
|
881
|
+
const { client } = await setupDriverTest(c, driverTestConfig);
|
|
882
|
+
const handle = client.counter.getOrCreate(["test-onopen"]);
|
|
883
|
+
const connection = handle.connect();
|
|
884
|
+
let openCount = 0;
|
|
885
|
+
connection.onOpen(() => {
|
|
886
|
+
openCount++;
|
|
887
|
+
});
|
|
888
|
+
await _vitest.vi.waitFor(() => {
|
|
889
|
+
_vitest.expect.call(void 0, openCount).toBe(1);
|
|
890
|
+
});
|
|
891
|
+
_vitest.expect.call(void 0, connection.isConnected).toBe(true);
|
|
892
|
+
await connection.dispose();
|
|
893
|
+
});
|
|
894
|
+
_vitest.test.call(void 0, "onClose should be called when connection closes via dispose", async (c) => {
|
|
895
|
+
const { client } = await setupDriverTest(c, driverTestConfig);
|
|
896
|
+
const handle = client.counter.getOrCreate(["test-onclose"]);
|
|
897
|
+
const connection = handle.connect();
|
|
898
|
+
let closeCount = 0;
|
|
899
|
+
connection.onClose(() => {
|
|
900
|
+
closeCount++;
|
|
901
|
+
});
|
|
902
|
+
await _vitest.vi.waitFor(() => {
|
|
903
|
+
_vitest.expect.call(void 0, connection.isConnected).toBe(true);
|
|
904
|
+
});
|
|
905
|
+
await connection.dispose();
|
|
906
|
+
_vitest.expect.call(void 0, closeCount).toBe(1);
|
|
907
|
+
_vitest.expect.call(void 0, connection.isConnected).toBe(false);
|
|
908
|
+
});
|
|
909
|
+
_vitest.test.call(void 0, "should be able to unsubscribe from onOpen", async (c) => {
|
|
910
|
+
const { client } = await setupDriverTest(c, driverTestConfig);
|
|
911
|
+
const handle = client.counter.getOrCreate([
|
|
912
|
+
"test-onopen-unsub"
|
|
913
|
+
]);
|
|
914
|
+
const connection = handle.connect();
|
|
915
|
+
let openCount = 0;
|
|
916
|
+
const unsubscribe = connection.onOpen(() => {
|
|
917
|
+
openCount++;
|
|
918
|
+
});
|
|
919
|
+
unsubscribe();
|
|
920
|
+
await _vitest.vi.waitFor(() => {
|
|
921
|
+
_vitest.expect.call(void 0, connection.isConnected).toBe(true);
|
|
922
|
+
});
|
|
923
|
+
_vitest.expect.call(void 0, openCount).toBe(0);
|
|
924
|
+
await connection.dispose();
|
|
925
|
+
});
|
|
926
|
+
_vitest.test.call(void 0, "should be able to unsubscribe from onClose", async (c) => {
|
|
927
|
+
const { client } = await setupDriverTest(c, driverTestConfig);
|
|
928
|
+
const handle = client.counter.getOrCreate([
|
|
929
|
+
"test-onclose-unsub"
|
|
930
|
+
]);
|
|
931
|
+
const connection = handle.connect();
|
|
932
|
+
let closeCount = 0;
|
|
933
|
+
const unsubscribe = connection.onClose(() => {
|
|
934
|
+
closeCount++;
|
|
935
|
+
});
|
|
936
|
+
await _vitest.vi.waitFor(() => {
|
|
937
|
+
_vitest.expect.call(void 0, connection.isConnected).toBe(true);
|
|
938
|
+
});
|
|
939
|
+
unsubscribe();
|
|
940
|
+
await connection.dispose();
|
|
941
|
+
_vitest.expect.call(void 0, closeCount).toBe(0);
|
|
942
|
+
});
|
|
943
|
+
_vitest.test.call(void 0, "multiple onOpen handlers should all be called", async (c) => {
|
|
944
|
+
const { client } = await setupDriverTest(c, driverTestConfig);
|
|
945
|
+
const handle = client.counter.getOrCreate([
|
|
946
|
+
"test-multi-onopen"
|
|
947
|
+
]);
|
|
948
|
+
const connection = handle.connect();
|
|
949
|
+
let handler1Called = false;
|
|
950
|
+
let handler2Called = false;
|
|
951
|
+
connection.onOpen(() => {
|
|
952
|
+
handler1Called = true;
|
|
953
|
+
});
|
|
954
|
+
connection.onOpen(() => {
|
|
955
|
+
handler2Called = true;
|
|
956
|
+
});
|
|
957
|
+
await _vitest.vi.waitFor(() => {
|
|
958
|
+
_vitest.expect.call(void 0, handler1Called).toBe(true);
|
|
959
|
+
_vitest.expect.call(void 0, handler2Called).toBe(true);
|
|
960
|
+
});
|
|
961
|
+
await connection.dispose();
|
|
962
|
+
});
|
|
963
|
+
_vitest.test.call(void 0, "multiple onClose handlers should all be called", async (c) => {
|
|
964
|
+
const { client } = await setupDriverTest(c, driverTestConfig);
|
|
965
|
+
const handle = client.counter.getOrCreate([
|
|
966
|
+
"test-multi-onclose"
|
|
967
|
+
]);
|
|
968
|
+
const connection = handle.connect();
|
|
969
|
+
let handler1Called = false;
|
|
970
|
+
let handler2Called = false;
|
|
971
|
+
connection.onClose(() => {
|
|
972
|
+
handler1Called = true;
|
|
973
|
+
});
|
|
974
|
+
connection.onClose(() => {
|
|
975
|
+
handler2Called = true;
|
|
976
|
+
});
|
|
977
|
+
await _vitest.vi.waitFor(() => {
|
|
978
|
+
_vitest.expect.call(void 0, connection.isConnected).toBe(true);
|
|
979
|
+
});
|
|
980
|
+
await connection.dispose();
|
|
981
|
+
_vitest.expect.call(void 0, handler1Called).toBe(true);
|
|
982
|
+
_vitest.expect.call(void 0, handler2Called).toBe(true);
|
|
983
|
+
});
|
|
984
|
+
});
|
|
867
985
|
});
|
|
868
986
|
}
|
|
869
987
|
|
|
@@ -872,7 +990,7 @@ function runActorConnTests(driverTestConfig) {
|
|
|
872
990
|
|
|
873
991
|
// fixtures/driver-test-suite/hibernation.ts
|
|
874
992
|
var HIBERNATION_SLEEP_TIMEOUT = 500;
|
|
875
|
-
var hibernationActor =
|
|
993
|
+
var hibernationActor = _chunkNYQJHQHKcjs.actor.call(void 0, {
|
|
876
994
|
state: {
|
|
877
995
|
sleepCount: 0,
|
|
878
996
|
wakeCount: 0
|
|
@@ -1455,7 +1573,7 @@ function runActorScheduleTests(driverTestConfig) {
|
|
|
1455
1573
|
|
|
1456
1574
|
// fixtures/driver-test-suite/sleep.ts
|
|
1457
1575
|
var SLEEP_TIMEOUT = 1e3;
|
|
1458
|
-
var sleep =
|
|
1576
|
+
var sleep = _chunkNYQJHQHKcjs.actor.call(void 0, {
|
|
1459
1577
|
state: { startCount: 0, sleepCount: 0 },
|
|
1460
1578
|
onWake: (c) => {
|
|
1461
1579
|
c.state.startCount += 1;
|
|
@@ -1484,7 +1602,7 @@ var sleep = _chunkBAEMOCS7cjs.actor.call(void 0, {
|
|
|
1484
1602
|
sleepTimeout: SLEEP_TIMEOUT
|
|
1485
1603
|
}
|
|
1486
1604
|
});
|
|
1487
|
-
var sleepWithLongRpc =
|
|
1605
|
+
var sleepWithLongRpc = _chunkNYQJHQHKcjs.actor.call(void 0, {
|
|
1488
1606
|
state: { startCount: 0, sleepCount: 0 },
|
|
1489
1607
|
createVars: () => ({}),
|
|
1490
1608
|
onWake: (c) => {
|
|
@@ -1502,7 +1620,7 @@ var sleepWithLongRpc = _chunkBAEMOCS7cjs.actor.call(void 0, {
|
|
|
1502
1620
|
},
|
|
1503
1621
|
longRunningRpc: async (c) => {
|
|
1504
1622
|
c.log.info("starting long running rpc");
|
|
1505
|
-
c.vars.longRunningResolve =
|
|
1623
|
+
c.vars.longRunningResolve = _chunkREMOXAIWcjs.promiseWithResolvers.call(void 0, );
|
|
1506
1624
|
c.broadcast("waiting");
|
|
1507
1625
|
await c.vars.longRunningResolve.promise;
|
|
1508
1626
|
c.log.info("finished long running rpc");
|
|
@@ -1516,7 +1634,7 @@ var sleepWithLongRpc = _chunkBAEMOCS7cjs.actor.call(void 0, {
|
|
|
1516
1634
|
sleepTimeout: SLEEP_TIMEOUT
|
|
1517
1635
|
}
|
|
1518
1636
|
});
|
|
1519
|
-
var sleepWithRawHttp =
|
|
1637
|
+
var sleepWithRawHttp = _chunkNYQJHQHKcjs.actor.call(void 0, {
|
|
1520
1638
|
state: { startCount: 0, sleepCount: 0, requestCount: 0 },
|
|
1521
1639
|
onWake: (c) => {
|
|
1522
1640
|
c.state.startCount += 1;
|
|
@@ -1553,7 +1671,7 @@ var sleepWithRawHttp = _chunkBAEMOCS7cjs.actor.call(void 0, {
|
|
|
1553
1671
|
sleepTimeout: SLEEP_TIMEOUT
|
|
1554
1672
|
}
|
|
1555
1673
|
});
|
|
1556
|
-
var sleepWithRawWebSocket =
|
|
1674
|
+
var sleepWithRawWebSocket = _chunkNYQJHQHKcjs.actor.call(void 0, {
|
|
1557
1675
|
state: { startCount: 0, sleepCount: 0, connectionCount: 0 },
|
|
1558
1676
|
onWake: (c) => {
|
|
1559
1677
|
c.state.startCount += 1;
|
|
@@ -1616,7 +1734,7 @@ var sleepWithRawWebSocket = _chunkBAEMOCS7cjs.actor.call(void 0, {
|
|
|
1616
1734
|
sleepTimeout: SLEEP_TIMEOUT
|
|
1617
1735
|
}
|
|
1618
1736
|
});
|
|
1619
|
-
var sleepWithNoSleepOption =
|
|
1737
|
+
var sleepWithNoSleepOption = _chunkNYQJHQHKcjs.actor.call(void 0, {
|
|
1620
1738
|
state: { startCount: 0, sleepCount: 0 },
|
|
1621
1739
|
onWake: (c) => {
|
|
1622
1740
|
c.state.startCount += 1;
|
|
@@ -2347,7 +2465,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2347
2465
|
_vitest.describe.call(void 0, "Manager Inspector", () => {
|
|
2348
2466
|
_vitest.test.call(void 0, "should respond to ping", async (c) => {
|
|
2349
2467
|
const { endpoint } = await setupDriverTest(c, driverTestConfig);
|
|
2350
|
-
const http =
|
|
2468
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2351
2469
|
`${endpoint}/inspect`,
|
|
2352
2470
|
{
|
|
2353
2471
|
headers: {
|
|
@@ -2367,7 +2485,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2367
2485
|
);
|
|
2368
2486
|
await client.counter.create(["test-actor-1"]);
|
|
2369
2487
|
await client.counter.create(["test-actor-2"]);
|
|
2370
|
-
const http =
|
|
2488
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2371
2489
|
`${endpoint}/inspect`,
|
|
2372
2490
|
{
|
|
2373
2491
|
headers: {
|
|
@@ -2396,7 +2514,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2396
2514
|
const actorKey2 = ["test-cursor-2"];
|
|
2397
2515
|
await client.counter.create(actorKey1);
|
|
2398
2516
|
await client.counter.create(actorKey2);
|
|
2399
|
-
const http =
|
|
2517
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2400
2518
|
`${endpoint}/inspect`,
|
|
2401
2519
|
{
|
|
2402
2520
|
headers: {
|
|
@@ -2424,7 +2542,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2424
2542
|
});
|
|
2425
2543
|
_vitest.test.call(void 0, "should handle invalid limit parameter", async (c) => {
|
|
2426
2544
|
const { endpoint } = await setupDriverTest(c, driverTestConfig);
|
|
2427
|
-
const http =
|
|
2545
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2428
2546
|
`${endpoint}/inspect`,
|
|
2429
2547
|
{
|
|
2430
2548
|
headers: {
|
|
@@ -2439,7 +2557,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2439
2557
|
});
|
|
2440
2558
|
_vitest.test.call(void 0, "should create a new actor", async (c) => {
|
|
2441
2559
|
const { endpoint } = await setupDriverTest(c, driverTestConfig);
|
|
2442
|
-
const http =
|
|
2560
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2443
2561
|
`${endpoint}/inspect`,
|
|
2444
2562
|
{
|
|
2445
2563
|
headers: {
|
|
@@ -2466,7 +2584,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2466
2584
|
});
|
|
2467
2585
|
_vitest.test.call(void 0, "should get builds", async (c) => {
|
|
2468
2586
|
const { endpoint } = await setupDriverTest(c, driverTestConfig);
|
|
2469
|
-
const http =
|
|
2587
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2470
2588
|
`${endpoint}/inspect`,
|
|
2471
2589
|
{
|
|
2472
2590
|
headers: {
|
|
@@ -2490,7 +2608,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2490
2608
|
);
|
|
2491
2609
|
const handle = await client.counter.create(["test-get-by-id"]);
|
|
2492
2610
|
const actorId = await handle.resolve();
|
|
2493
|
-
const http =
|
|
2611
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2494
2612
|
`${endpoint}/inspect`,
|
|
2495
2613
|
{
|
|
2496
2614
|
headers: {
|
|
@@ -2507,7 +2625,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2507
2625
|
});
|
|
2508
2626
|
_vitest.test.call(void 0, "should return 404 for non-existent actor", async (c) => {
|
|
2509
2627
|
const { endpoint } = await setupDriverTest(c, driverTestConfig);
|
|
2510
|
-
const http =
|
|
2628
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2511
2629
|
`${endpoint}/inspect`,
|
|
2512
2630
|
{
|
|
2513
2631
|
headers: {
|
|
@@ -2529,7 +2647,7 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2529
2647
|
);
|
|
2530
2648
|
const handle = await client.counter.create(["test-bootstrap"]);
|
|
2531
2649
|
await handle.resolve();
|
|
2532
|
-
const http =
|
|
2650
|
+
const http = _chunk3WG6PXWEcjs.createManagerInspectorClient.call(void 0,
|
|
2533
2651
|
`${endpoint}/inspect`,
|
|
2534
2652
|
{
|
|
2535
2653
|
headers: {
|
|
@@ -2554,12 +2672,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2554
2672
|
_vitest.test.call(void 0, "should handle actor not found", async (c) => {
|
|
2555
2673
|
const { endpoint } = await setupDriverTest(c, driverTestConfig);
|
|
2556
2674
|
const actorId = "non-existing";
|
|
2557
|
-
const http =
|
|
2675
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2558
2676
|
`${endpoint}/actors/inspect`,
|
|
2559
2677
|
{
|
|
2560
2678
|
headers: {
|
|
2561
2679
|
Authorization: `Bearer token`,
|
|
2562
|
-
[
|
|
2680
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2563
2681
|
getForId: { name: "counter", actorId }
|
|
2564
2682
|
})
|
|
2565
2683
|
}
|
|
@@ -2575,12 +2693,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2575
2693
|
);
|
|
2576
2694
|
const handle = await client.counter.create(["test-ping"]);
|
|
2577
2695
|
const actorId = await handle.resolve();
|
|
2578
|
-
const http =
|
|
2696
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2579
2697
|
`${endpoint}/actors/inspect`,
|
|
2580
2698
|
{
|
|
2581
2699
|
headers: {
|
|
2582
2700
|
Authorization: `Bearer token`,
|
|
2583
|
-
[
|
|
2701
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2584
2702
|
getForId: { name: "counter", actorId }
|
|
2585
2703
|
})
|
|
2586
2704
|
}
|
|
@@ -2599,12 +2717,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2599
2717
|
const handle = await client.counter.create(["test-state"]);
|
|
2600
2718
|
const actorId = await handle.resolve();
|
|
2601
2719
|
await handle.increment(5);
|
|
2602
|
-
const http =
|
|
2720
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2603
2721
|
`${endpoint}/actors/inspect`,
|
|
2604
2722
|
{
|
|
2605
2723
|
headers: {
|
|
2606
2724
|
Authorization: `Bearer token`,
|
|
2607
|
-
[
|
|
2725
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2608
2726
|
getForId: { name: "counter", actorId }
|
|
2609
2727
|
})
|
|
2610
2728
|
}
|
|
@@ -2629,12 +2747,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2629
2747
|
"test-state-replace"
|
|
2630
2748
|
]);
|
|
2631
2749
|
const actorId = await handle.resolve();
|
|
2632
|
-
const http =
|
|
2750
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2633
2751
|
`${endpoint}/actors/inspect`,
|
|
2634
2752
|
{
|
|
2635
2753
|
headers: {
|
|
2636
2754
|
Authorization: `Bearer token`,
|
|
2637
|
-
[
|
|
2755
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2638
2756
|
getForId: { name: "counter", actorId }
|
|
2639
2757
|
})
|
|
2640
2758
|
}
|
|
@@ -2662,12 +2780,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2662
2780
|
]);
|
|
2663
2781
|
const actorId = await handle.resolve();
|
|
2664
2782
|
await handle.increment(3);
|
|
2665
|
-
const http =
|
|
2783
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2666
2784
|
`${endpoint}/actors/inspect`,
|
|
2667
2785
|
{
|
|
2668
2786
|
headers: {
|
|
2669
2787
|
Authorization: `Bearer token`,
|
|
2670
|
-
[
|
|
2788
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2671
2789
|
getForId: { name: "counter", actorId }
|
|
2672
2790
|
})
|
|
2673
2791
|
}
|
|
@@ -2704,12 +2822,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2704
2822
|
const actorId = await handle.resolve();
|
|
2705
2823
|
handle.connect();
|
|
2706
2824
|
await handle.increment(10);
|
|
2707
|
-
const http =
|
|
2825
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2708
2826
|
`${endpoint}/actors/inspect`,
|
|
2709
2827
|
{
|
|
2710
2828
|
headers: {
|
|
2711
2829
|
Authorization: `Bearer token`,
|
|
2712
|
-
[
|
|
2830
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2713
2831
|
getForId: { name: "counter", actorId }
|
|
2714
2832
|
})
|
|
2715
2833
|
}
|
|
@@ -2735,12 +2853,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2735
2853
|
const actorId = await handle.resolve();
|
|
2736
2854
|
handle.connect();
|
|
2737
2855
|
await handle.increment(10);
|
|
2738
|
-
const http =
|
|
2856
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2739
2857
|
`${endpoint}/actors/inspect`,
|
|
2740
2858
|
{
|
|
2741
2859
|
headers: {
|
|
2742
2860
|
Authorization: `Bearer token`,
|
|
2743
|
-
[
|
|
2861
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2744
2862
|
getForId: { name: "counter", actorId }
|
|
2745
2863
|
})
|
|
2746
2864
|
}
|
|
@@ -2769,12 +2887,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2769
2887
|
const actorId = await handle.resolve();
|
|
2770
2888
|
handle.connect();
|
|
2771
2889
|
await handle.increment(10);
|
|
2772
|
-
const http =
|
|
2890
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2773
2891
|
`${endpoint}/actors/inspect`,
|
|
2774
2892
|
{
|
|
2775
2893
|
headers: {
|
|
2776
2894
|
Authorization: `Bearer token`,
|
|
2777
|
-
[
|
|
2895
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2778
2896
|
getForId: { name: "counter", actorId }
|
|
2779
2897
|
})
|
|
2780
2898
|
}
|
|
@@ -2803,12 +2921,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2803
2921
|
);
|
|
2804
2922
|
const handle = await client.counter.create(["test-rpcs"]);
|
|
2805
2923
|
const actorId = await handle.resolve();
|
|
2806
|
-
const http =
|
|
2924
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2807
2925
|
`${endpoint}/actors/inspect`,
|
|
2808
2926
|
{
|
|
2809
2927
|
headers: {
|
|
2810
2928
|
Authorization: `Bearer token`,
|
|
2811
|
-
[
|
|
2929
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2812
2930
|
getForId: { name: "counter", actorId }
|
|
2813
2931
|
})
|
|
2814
2932
|
}
|
|
@@ -2830,12 +2948,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2830
2948
|
);
|
|
2831
2949
|
const handle = await client.counter.create(["test-db"]);
|
|
2832
2950
|
const actorId = await handle.resolve();
|
|
2833
|
-
const http =
|
|
2951
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2834
2952
|
`${endpoint}/actors/inspect`,
|
|
2835
2953
|
{
|
|
2836
2954
|
headers: {
|
|
2837
2955
|
Authorization: `Bearer token`,
|
|
2838
|
-
[
|
|
2956
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2839
2957
|
getForId: { name: "counter", actorId }
|
|
2840
2958
|
})
|
|
2841
2959
|
}
|
|
@@ -2860,12 +2978,12 @@ function runActorInspectorTests(driverTestConfig) {
|
|
|
2860
2978
|
);
|
|
2861
2979
|
const handle = await client.counter.create(["test-db-query"]);
|
|
2862
2980
|
const actorId = await handle.resolve();
|
|
2863
|
-
const http =
|
|
2981
|
+
const http = _chunk3WG6PXWEcjs.createActorInspectorClient.call(void 0,
|
|
2864
2982
|
`${endpoint}/actors/inspect`,
|
|
2865
2983
|
{
|
|
2866
2984
|
headers: {
|
|
2867
2985
|
Authorization: `Bearer token`,
|
|
2868
|
-
[
|
|
2986
|
+
[_chunk23EJLAOVcjs.HEADER_ACTOR_QUERY]: JSON.stringify({
|
|
2869
2987
|
getForId: { name: "counter", actorId }
|
|
2870
2988
|
})
|
|
2871
2989
|
}
|
|
@@ -4411,7 +4529,7 @@ async function createTestRuntime(registryPath, driverFactory) {
|
|
|
4411
4529
|
};
|
|
4412
4530
|
} else {
|
|
4413
4531
|
let upgradeWebSocket;
|
|
4414
|
-
const config =
|
|
4532
|
+
const config = _chunkF4CRQFYGcjs.RunnerConfigSchema.parse({
|
|
4415
4533
|
driver,
|
|
4416
4534
|
getUpgradeWebSocket: () => upgradeWebSocket,
|
|
4417
4535
|
inspector: {
|
|
@@ -4420,12 +4538,12 @@ async function createTestRuntime(registryPath, driverFactory) {
|
|
|
4420
4538
|
}
|
|
4421
4539
|
});
|
|
4422
4540
|
const managerDriver = driver.manager(registry.config, config);
|
|
4423
|
-
const client =
|
|
4541
|
+
const client = _chunkZUJRXXQCcjs.createClientWithDriver.call(void 0,
|
|
4424
4542
|
managerDriver,
|
|
4425
|
-
|
|
4543
|
+
_chunkF4CRQFYGcjs.ClientConfigSchema.parse({})
|
|
4426
4544
|
);
|
|
4427
|
-
|
|
4428
|
-
const { router } =
|
|
4545
|
+
_chunk3WG6PXWEcjs.configureInspectorAccessToken.call(void 0, config, managerDriver);
|
|
4546
|
+
const { router } = _chunkNYQJHQHKcjs.createManagerRouter.call(void 0,
|
|
4429
4547
|
registry.config,
|
|
4430
4548
|
config,
|
|
4431
4549
|
managerDriver,
|
|
@@ -4434,7 +4552,7 @@ async function createTestRuntime(registryPath, driverFactory) {
|
|
|
4434
4552
|
);
|
|
4435
4553
|
const nodeWebSocket = _nodews.createNodeWebSocket.call(void 0, { app: router });
|
|
4436
4554
|
upgradeWebSocket = nodeWebSocket.upgradeWebSocket;
|
|
4437
|
-
const port = await
|
|
4555
|
+
const port = await _chunk46DWBVYEcjs.getPort.call(void 0, );
|
|
4438
4556
|
const server = _nodeserver.serve.call(void 0, {
|
|
4439
4557
|
fetch: router.fetch,
|
|
4440
4558
|
hostname: "127.0.0.1",
|