@@ -48,8 +48,8 @@ use model::{
4848 file_storage:: FileStorageId ,
4949 session_requests:: types:: SessionRequestIdentifier ,
5050} ;
51- use serde_json:: Value as JsonValue ;
5251use sync_types:: {
52+ types:: SerializedArgs ,
5353 AuthenticationToken ,
5454 SerializedQueryJournal ,
5555 Timestamp ,
@@ -107,7 +107,7 @@ pub trait ApplicationApi: Send + Sync {
107107 request_id : RequestId ,
108108 identity : Identity ,
109109 path : ExportPath ,
110- args : Vec < JsonValue > ,
110+ args : SerializedArgs ,
111111 caller : FunctionCaller ,
112112 ts : ExecuteQueryTimestamp ,
113113 journal : Option < SerializedQueryJournal > ,
@@ -122,7 +122,7 @@ pub trait ApplicationApi: Send + Sync {
122122 request_id : RequestId ,
123123 identity : Identity ,
124124 path : CanonicalizedComponentFunctionPath ,
125- args : Vec < JsonValue > ,
125+ args : SerializedArgs ,
126126 caller : FunctionCaller ,
127127 ts : ExecuteQueryTimestamp ,
128128 journal : Option < SerializedQueryJournal > ,
@@ -135,7 +135,7 @@ pub trait ApplicationApi: Send + Sync {
135135 request_id : RequestId ,
136136 identity : Identity ,
137137 path : ExportPath ,
138- args : Vec < JsonValue > ,
138+ args : SerializedArgs ,
139139 caller : FunctionCaller ,
140140 // Identifier used to make this mutation idempotent.
141141 mutation_identifier : Option < SessionRequestIdentifier > ,
@@ -150,7 +150,7 @@ pub trait ApplicationApi: Send + Sync {
150150 request_id : RequestId ,
151151 identity : Identity ,
152152 path : CanonicalizedComponentFunctionPath ,
153- args : Vec < JsonValue > ,
153+ args : SerializedArgs ,
154154 caller : FunctionCaller ,
155155 mutation_identifier : Option < SessionRequestIdentifier > ,
156156 // The length of the mutation queue at the time the mutation was executed.
@@ -164,7 +164,7 @@ pub trait ApplicationApi: Send + Sync {
164164 request_id : RequestId ,
165165 identity : Identity ,
166166 path : ExportPath ,
167- args : Vec < JsonValue > ,
167+ args : SerializedArgs ,
168168 caller : FunctionCaller ,
169169 ) -> anyhow:: Result < Result < RedactedActionReturn , RedactedActionError > > ;
170170
@@ -175,7 +175,7 @@ pub trait ApplicationApi: Send + Sync {
175175 request_id : RequestId ,
176176 identity : Identity ,
177177 path : CanonicalizedComponentFunctionPath ,
178- args : Vec < JsonValue > ,
178+ args : SerializedArgs ,
179179 caller : FunctionCaller ,
180180 ) -> anyhow:: Result < Result < RedactedActionReturn , RedactedActionError > > ;
181181
@@ -199,7 +199,7 @@ pub trait ApplicationApi: Send + Sync {
199199 request_id : RequestId ,
200200 identity : Identity ,
201201 path : CanonicalizedComponentFunctionPath ,
202- args : Vec < JsonValue > ,
202+ args : SerializedArgs ,
203203 caller : FunctionCaller ,
204204 ) -> anyhow:: Result < Result < FunctionReturn , FunctionError > > ;
205205
@@ -283,7 +283,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
283283 request_id : RequestId ,
284284 identity : Identity ,
285285 path : ExportPath ,
286- args : Vec < JsonValue > ,
286+ args : SerializedArgs ,
287287 caller : FunctionCaller ,
288288 ts : ExecuteQueryTimestamp ,
289289 journal : Option < SerializedQueryJournal > ,
@@ -299,7 +299,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
299299 self . read_only_udf_at_ts (
300300 request_id,
301301 PublicFunctionPath :: RootExport ( path) ,
302- args,
302+ args. into_args ( ) ? ,
303303 identity,
304304 ts,
305305 journal,
@@ -314,7 +314,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
314314 request_id : RequestId ,
315315 identity : Identity ,
316316 path : CanonicalizedComponentFunctionPath ,
317- args : Vec < JsonValue > ,
317+ args : SerializedArgs ,
318318 caller : FunctionCaller ,
319319 ts : ExecuteQueryTimestamp ,
320320 journal : Option < SerializedQueryJournal > ,
@@ -330,7 +330,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
330330 self . read_only_udf_at_ts (
331331 request_id,
332332 PublicFunctionPath :: Component ( path) ,
333- args,
333+ args. into_args ( ) ? ,
334334 identity,
335335 ts,
336336 journal,
@@ -345,7 +345,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
345345 request_id : RequestId ,
346346 identity : Identity ,
347347 path : ExportPath ,
348- args : Vec < JsonValue > ,
348+ args : SerializedArgs ,
349349 caller : FunctionCaller ,
350350 // Identifier used to make this mutation idempotent.
351351 mutation_identifier : Option < SessionRequestIdentifier > ,
@@ -358,7 +358,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
358358 self . mutation_udf (
359359 request_id,
360360 PublicFunctionPath :: RootExport ( path) ,
361- args,
361+ args. into_args ( ) ? ,
362362 identity,
363363 mutation_identifier,
364364 caller,
@@ -373,7 +373,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
373373 request_id : RequestId ,
374374 identity : Identity ,
375375 path : CanonicalizedComponentFunctionPath ,
376- args : Vec < JsonValue > ,
376+ args : SerializedArgs ,
377377 caller : FunctionCaller ,
378378 mutation_identifier : Option < SessionRequestIdentifier > ,
379379 mutation_queue_length : Option < usize > ,
@@ -385,7 +385,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
385385 self . mutation_udf (
386386 request_id,
387387 PublicFunctionPath :: Component ( path) ,
388- args,
388+ args. into_args ( ) ? ,
389389 identity,
390390 mutation_identifier,
391391 caller,
@@ -400,7 +400,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
400400 request_id : RequestId ,
401401 identity : Identity ,
402402 path : ExportPath ,
403- args : Vec < JsonValue > ,
403+ args : SerializedArgs ,
404404 caller : FunctionCaller ,
405405 ) -> anyhow:: Result < Result < RedactedActionReturn , RedactedActionError > > {
406406 anyhow:: ensure!(
@@ -410,7 +410,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
410410 self . action_udf (
411411 request_id,
412412 PublicFunctionPath :: RootExport ( path) ,
413- args,
413+ args. into_args ( ) ? ,
414414 identity,
415415 caller,
416416 )
@@ -423,7 +423,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
423423 request_id : RequestId ,
424424 identity : Identity ,
425425 path : CanonicalizedComponentFunctionPath ,
426- args : Vec < JsonValue > ,
426+ args : SerializedArgs ,
427427 caller : FunctionCaller ,
428428 ) -> anyhow:: Result < Result < RedactedActionReturn , RedactedActionError > > {
429429 anyhow:: ensure!(
@@ -433,7 +433,7 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
433433 self . action_udf (
434434 request_id,
435435 PublicFunctionPath :: Component ( path) ,
436- args,
436+ args. into_args ( ) ? ,
437437 identity,
438438 caller,
439439 )
@@ -446,14 +446,15 @@ impl<RT: Runtime> ApplicationApi for Application<RT> {
446446 request_id : RequestId ,
447447 identity : Identity ,
448448 path : CanonicalizedComponentFunctionPath ,
449- args : Vec < JsonValue > ,
449+ args : SerializedArgs ,
450450 caller : FunctionCaller ,
451451 ) -> anyhow:: Result < Result < FunctionReturn , FunctionError > > {
452452 anyhow:: ensure!(
453453 path. component. is_root( ) || identity. is_admin( ) || identity. is_system( ) ,
454454 "Only admin or system users can call functions on non-root components directly"
455455 ) ;
456- self . any_udf ( request_id, path, args, identity, caller) . await
456+ self . any_udf ( request_id, path, args. into_args ( ) ?, identity, caller)
457+ . await
457458 }
458459
459460 async fn latest_timestamp (
0 commit comments