rivetkit 2.0.25-rc.2 → 2.0.26
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-AOC3ALJK.js → chunk-3ZTRZIA5.js} +5 -5
- package/dist/tsup/chunk-3ZTRZIA5.js.map +1 -0
- package/dist/tsup/{chunk-MPTF4FZG.js → chunk-6ZAGP4Y3.js} +11 -8
- package/dist/tsup/{chunk-MPTF4FZG.js.map → chunk-6ZAGP4Y3.js.map} +1 -1
- package/dist/tsup/{chunk-SMZOHIR5.cjs → chunk-77UIPJTD.cjs} +5 -5
- package/dist/tsup/chunk-77UIPJTD.cjs.map +1 -0
- package/dist/tsup/{chunk-SSNBAXAL.js → chunk-AYDCXNX6.js} +2 -2
- package/dist/tsup/{chunk-DFFRL6SA.cjs → chunk-CFMLY3P6.cjs} +32 -25
- package/dist/tsup/chunk-CFMLY3P6.cjs.map +1 -0
- package/dist/tsup/{chunk-YGJY4IOG.js → chunk-E6MTJS4R.js} +3 -3
- package/dist/tsup/{chunk-NEFTKDFY.js → chunk-EX6XY7A4.js} +2 -2
- package/dist/tsup/{chunk-F5WMZYRB.js → chunk-GMQ44WPZ.js} +2 -2
- package/dist/tsup/{chunk-THRFFSBO.js → chunk-K5JMIH4N.js} +18 -8
- package/dist/tsup/chunk-K5JMIH4N.js.map +1 -0
- package/dist/tsup/{chunk-RIL2JIJZ.cjs → chunk-N6VIFATJ.cjs} +10 -10
- package/dist/tsup/{chunk-RIL2JIJZ.cjs.map → chunk-N6VIFATJ.cjs.map} +1 -1
- package/dist/tsup/{chunk-P4SJXGDU.cjs → chunk-NEM3XQSZ.cjs} +209 -199
- package/dist/tsup/chunk-NEM3XQSZ.cjs.map +1 -0
- package/dist/tsup/{chunk-X6P24ETW.js → chunk-NFQAYLE5.js} +18 -11
- package/dist/tsup/chunk-NFQAYLE5.js.map +1 -0
- package/dist/tsup/{chunk-EXPDBKWU.cjs → chunk-SWFPKHMT.cjs} +193 -192
- package/dist/tsup/chunk-SWFPKHMT.cjs.map +1 -0
- package/dist/tsup/{chunk-7GJFQFMT.cjs → chunk-UORP3ABY.cjs} +6 -6
- package/dist/tsup/{chunk-7GJFQFMT.cjs.map → chunk-UORP3ABY.cjs.map} +1 -1
- package/dist/tsup/{chunk-YUEDTVPT.js → chunk-WIFZEE5R.js} +31 -30
- package/dist/tsup/chunk-WIFZEE5R.js.map +1 -0
- package/dist/tsup/{chunk-TVYPMJFQ.cjs → chunk-WJKKE5CN.cjs} +3 -3
- package/dist/tsup/{chunk-TVYPMJFQ.cjs.map → chunk-WJKKE5CN.cjs.map} +1 -1
- package/dist/tsup/{chunk-QNWST7TA.cjs → chunk-X4OVVIPR.cjs} +3 -3
- package/dist/tsup/{chunk-QNWST7TA.cjs.map → chunk-X4OVVIPR.cjs.map} +1 -1
- package/dist/tsup/{chunk-HSFEZOYD.cjs → chunk-Z2YB6STQ.cjs} +18 -15
- package/dist/tsup/chunk-Z2YB6STQ.cjs.map +1 -0
- package/dist/tsup/{chunk-JQETOQ3U.cjs → chunk-ZIAFEFUK.cjs} +6 -6
- package/dist/tsup/{chunk-JQETOQ3U.cjs.map → chunk-ZIAFEFUK.cjs.map} +1 -1
- package/dist/tsup/{chunk-GOYBQC6L.js → chunk-ZX3AUO3B.js} +2 -2
- 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.d.cts +9 -1
- package/dist/tsup/common/log.d.ts +9 -1
- 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-Bo-blHpJ.d.ts → config-B7x9hjVu.d.ts} +295 -880
- package/dist/tsup/{config-BRDYDraU.d.cts → config-DdCBN35E.d.cts} +295 -880
- 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 +71 -71
- 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 +10 -10
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.d.cts +4 -4
- package/dist/tsup/inspector/mod.d.ts +4 -4
- 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 +10 -10
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +9 -9
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/package.json +5 -5
- package/src/actor/config.ts +21 -20
- package/src/actor/instance/state-manager.ts +12 -2
- package/src/client/config.ts +1 -1
- package/src/drivers/engine/config.ts +6 -3
- package/src/inspector/config.ts +1 -2
- package/src/manager/router-schema.ts +7 -7
- package/src/registry/run-config.ts +9 -5
- package/src/remote-manager-driver/actor-http-client.ts +1 -1
- package/src/test/config.ts +13 -12
- package/dist/tsup/chunk-AOC3ALJK.js.map +0 -1
- package/dist/tsup/chunk-DFFRL6SA.cjs.map +0 -1
- package/dist/tsup/chunk-EXPDBKWU.cjs.map +0 -1
- package/dist/tsup/chunk-HSFEZOYD.cjs.map +0 -1
- package/dist/tsup/chunk-P4SJXGDU.cjs.map +0 -1
- package/dist/tsup/chunk-SMZOHIR5.cjs.map +0 -1
- package/dist/tsup/chunk-THRFFSBO.js.map +0 -1
- package/dist/tsup/chunk-X6P24ETW.js.map +0 -1
- package/dist/tsup/chunk-YUEDTVPT.js.map +0 -1
- /package/dist/tsup/{chunk-SSNBAXAL.js.map → chunk-AYDCXNX6.js.map} +0 -0
- /package/dist/tsup/{chunk-YGJY4IOG.js.map → chunk-E6MTJS4R.js.map} +0 -0
- /package/dist/tsup/{chunk-NEFTKDFY.js.map → chunk-EX6XY7A4.js.map} +0 -0
- /package/dist/tsup/{chunk-F5WMZYRB.js.map → chunk-GMQ44WPZ.js.map} +0 -0
- /package/dist/tsup/{chunk-GOYBQC6L.js.map → chunk-ZX3AUO3B.js.map} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkNEM3XQSZcjs = require('./chunk-NEM3XQSZ.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkCFMLY3P6cjs = require('./chunk-CFMLY3P6.cjs');
|
|
8
8
|
|
|
9
9
|
// src/client/mod.ts
|
|
10
10
|
function createClient(endpointOrConfig) {
|
|
11
11
|
const configInput = endpointOrConfig === void 0 ? {} : typeof endpointOrConfig === "string" ? { endpoint: endpointOrConfig } : endpointOrConfig;
|
|
12
|
-
const config =
|
|
13
|
-
const driver = new (0,
|
|
14
|
-
return
|
|
12
|
+
const config = _chunkCFMLY3P6cjs.ClientConfigSchema.parse(configInput);
|
|
13
|
+
const driver = new (0, _chunkNEM3XQSZcjs.RemoteManagerDriver)(config);
|
|
14
|
+
return _chunkNEM3XQSZcjs.createClientWithDriver.call(void 0, driver, config);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
exports.createClient = createClient;
|
|
20
|
-
//# sourceMappingURL=chunk-
|
|
20
|
+
//# sourceMappingURL=chunk-UORP3ABY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-UORP3ABY.cjs","../../src/client/mod.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACmCO,SAAS,YAAA,CACf,gBAAA,EACY;AAEZ,EAAA,MAAM,YAAA,EACL,iBAAA,IAAqB,KAAA,EAAA,EAClB,CAAC,EAAA,EACD,OAAO,iBAAA,IAAqB,SAAA,EAC3B,EAAE,QAAA,EAAU,iBAAiB,EAAA,EAC7B,gBAAA;AACL,EAAA,MAAM,OAAA,EAAS,oCAAA,CAAmB,KAAA,CAAM,WAAW,CAAA;AAGnD,EAAA,MAAM,OAAA,EAAS,IAAI,0CAAA,CAAoB,MAAM,CAAA;AAC7C,EAAA,OAAO,sDAAA,MAA0B,EAAQ,MAAM,CAAA;AAChD;AD3CA;AACA;AACE;AACF,oCAAC","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/chunk-UORP3ABY.cjs","sourcesContent":[null,"import type { Registry } from \"@/registry/mod\";\nimport { RemoteManagerDriver } from \"@/remote-manager-driver/mod\";\nimport {\n\ttype Client,\n\ttype ClientConfigInput,\n\tcreateClientWithDriver,\n} from \"./client\";\nimport { ClientConfigSchema } from \"./config\";\n\nexport {\n\tActorDefinition,\n\tAnyActorDefinition,\n} from \"@/actor/definition\";\nexport type { Encoding } from \"@/actor/protocol/serde\";\nexport {\n\tActorClientError,\n\tActorError,\n\tInternalError,\n\tMalformedResponseMessage,\n\tManagerError,\n} from \"@/client/errors\";\nexport type { CreateRequest } from \"@/manager/protocol/query\";\nexport type { ActorActionFunction } from \"./actor-common\";\nexport type { ActorConn, EventUnsubscribe } from \"./actor-conn\";\nexport { ActorConnRaw } from \"./actor-conn\";\nexport type { ActorHandle } from \"./actor-handle\";\nexport { ActorHandleRaw } from \"./actor-handle\";\nexport type {\n\tActorAccessor,\n\tClient,\n\tClientRaw,\n\tCreateOptions,\n\tExtractActorsFromRegistry,\n\tExtractRegistryFromClient,\n\tGetOptions,\n\tGetWithIdOptions,\n\tQueryOptions,\n\tRegion,\n} from \"./client\";\n\n/**\n * Creates a client with the actor accessor proxy.\n */\nexport function createClient<A extends Registry<any>>(\n\tendpointOrConfig?: string | ClientConfigInput,\n): Client<A> {\n\t// Parse config\n\tconst configInput =\n\t\tendpointOrConfig === undefined\n\t\t\t? {}\n\t\t\t: typeof endpointOrConfig === \"string\"\n\t\t\t\t? { endpoint: endpointOrConfig }\n\t\t\t\t: endpointOrConfig;\n\tconst config = ClientConfigSchema.parse(configInput);\n\n\t// Create client\n\tconst driver = new RemoteManagerDriver(config);\n\treturn createClientWithDriver<A>(driver, config);\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
inspectorLogger,
|
|
5
5
|
isInspectorEnabled,
|
|
6
6
|
secureInspector
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EX6XY7A4.js";
|
|
8
8
|
import {
|
|
9
9
|
ActionContext,
|
|
10
10
|
ActorDefinition,
|
|
@@ -28,17 +28,17 @@ import {
|
|
|
28
28
|
parseMessage,
|
|
29
29
|
serializeActorKey,
|
|
30
30
|
updateRunnerConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-K5JMIH4N.js";
|
|
32
32
|
import {
|
|
33
33
|
CreateActorSchema
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-GMQ44WPZ.js";
|
|
35
35
|
import {
|
|
36
36
|
ClientConfigSchema,
|
|
37
37
|
KEYS,
|
|
38
38
|
RunnerConfigSchema,
|
|
39
39
|
createVersionedDataHandler,
|
|
40
40
|
getInitialActorKvState
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-NFQAYLE5.js";
|
|
42
42
|
import {
|
|
43
43
|
EncodingSchema,
|
|
44
44
|
HEADER_ACTOR_ID,
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
generateRandomString,
|
|
61
61
|
loggerWithoutContext,
|
|
62
62
|
serializeWithEncoding
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-ZX3AUO3B.js";
|
|
64
64
|
import {
|
|
65
65
|
VERSION,
|
|
66
66
|
arrayBuffersEqual,
|
|
@@ -76,7 +76,7 @@ import {
|
|
|
76
76
|
promiseWithResolvers,
|
|
77
77
|
setLongTimeout,
|
|
78
78
|
stringifyError
|
|
79
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-3ZTRZIA5.js";
|
|
80
80
|
import {
|
|
81
81
|
ActorDuplicateKey,
|
|
82
82
|
ActorStopping,
|
|
@@ -91,26 +91,27 @@ import {
|
|
|
91
91
|
|
|
92
92
|
// src/actor/config.ts
|
|
93
93
|
import { z } from "zod";
|
|
94
|
+
var zFunction = () => z.custom((val) => typeof val === "function");
|
|
94
95
|
var ActorConfigSchema = z.object({
|
|
95
|
-
onCreate:
|
|
96
|
-
onDestroy:
|
|
97
|
-
onWake:
|
|
98
|
-
onSleep:
|
|
99
|
-
onStateChange:
|
|
100
|
-
onBeforeConnect:
|
|
101
|
-
onConnect:
|
|
102
|
-
onDisconnect:
|
|
103
|
-
onBeforeActionResponse:
|
|
104
|
-
onRequest:
|
|
105
|
-
onWebSocket:
|
|
106
|
-
actions: z.record(z.
|
|
96
|
+
onCreate: zFunction().optional(),
|
|
97
|
+
onDestroy: zFunction().optional(),
|
|
98
|
+
onWake: zFunction().optional(),
|
|
99
|
+
onSleep: zFunction().optional(),
|
|
100
|
+
onStateChange: zFunction().optional(),
|
|
101
|
+
onBeforeConnect: zFunction().optional(),
|
|
102
|
+
onConnect: zFunction().optional(),
|
|
103
|
+
onDisconnect: zFunction().optional(),
|
|
104
|
+
onBeforeActionResponse: zFunction().optional(),
|
|
105
|
+
onRequest: zFunction().optional(),
|
|
106
|
+
onWebSocket: zFunction().optional(),
|
|
107
|
+
actions: z.record(z.string(), zFunction()).default(() => ({})),
|
|
107
108
|
state: z.any().optional(),
|
|
108
|
-
createState:
|
|
109
|
+
createState: zFunction().optional(),
|
|
109
110
|
connState: z.any().optional(),
|
|
110
|
-
createConnState:
|
|
111
|
+
createConnState: zFunction().optional(),
|
|
111
112
|
vars: z.any().optional(),
|
|
112
113
|
db: z.any().optional(),
|
|
113
|
-
createVars:
|
|
114
|
+
createVars: zFunction().optional(),
|
|
114
115
|
options: z.object({
|
|
115
116
|
createVarsTimeout: z.number().positive().default(5e3),
|
|
116
117
|
createConnStateTimeout: z.number().positive().default(5e3),
|
|
@@ -135,9 +136,9 @@ var ActorConfigSchema = z.object({
|
|
|
135
136
|
**/
|
|
136
137
|
canHibernateWebSocket: z.union([
|
|
137
138
|
z.boolean(),
|
|
138
|
-
|
|
139
|
+
zFunction()
|
|
139
140
|
]).default(false)
|
|
140
|
-
}).strict().
|
|
141
|
+
}).strict().prefault(() => ({}))
|
|
141
142
|
}).strict().refine(
|
|
142
143
|
(data) => !(data.state !== void 0 && data.createState !== void 0),
|
|
143
144
|
{
|
|
@@ -4237,17 +4238,17 @@ async function createTestWebSocketProxy(clientWsPromise) {
|
|
|
4237
4238
|
import { z as z5 } from "zod";
|
|
4238
4239
|
var ServerlessStartHeadersSchema = z5.object({
|
|
4239
4240
|
endpoint: z5.string({
|
|
4240
|
-
|
|
4241
|
+
error: "x-rivet-endpoint header is required"
|
|
4241
4242
|
}),
|
|
4242
|
-
token: z5.string({
|
|
4243
|
+
token: z5.string({ error: "x-rivet-token header must be a string" }).optional(),
|
|
4243
4244
|
totalSlots: z5.coerce.number({
|
|
4244
|
-
|
|
4245
|
-
}).int("x-rivet-total-slots header must be an integer").gte(1, "x-rivet-total-slots header must be positive"),
|
|
4245
|
+
error: "x-rivet-total-slots header must be a number"
|
|
4246
|
+
}).int({ error: "x-rivet-total-slots header must be an integer" }).gte(1, { error: "x-rivet-total-slots header must be positive" }),
|
|
4246
4247
|
runnerName: z5.string({
|
|
4247
|
-
|
|
4248
|
+
error: "x-rivet-runner-name header is required"
|
|
4248
4249
|
}),
|
|
4249
4250
|
namespace: z5.string({
|
|
4250
|
-
|
|
4251
|
+
error: "x-rivet-namespace-name header is required"
|
|
4251
4252
|
})
|
|
4252
4253
|
});
|
|
4253
4254
|
|
|
@@ -5041,4 +5042,4 @@ export {
|
|
|
5041
5042
|
setup
|
|
5042
5043
|
};
|
|
5043
5044
|
//! These configs configs hold anything that's not platform-specific about running actors.
|
|
5044
|
-
//# sourceMappingURL=chunk-
|
|
5045
|
+
//# sourceMappingURL=chunk-WIFZEE5R.js.map
|