File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -561,11 +561,11 @@ export const JsonExecutionSdkParamsSchema = LitActionSdkParamsSchema.pick({
561561 /**
562562 * JS code to run on the nodes
563563 */
564- code : z . string ( ) . optional ( ) , // TODO one or the other
564+ code : z . string ( ) . optional ( ) ,
565565 /**
566566 * The IPFS ID of some JS code to run on the nodes
567567 */
568- ipfsId : z . string ( ) . optional ( ) , // TODO one or the other
568+ ipfsId : z . string ( ) . optional ( ) ,
569569 /**
570570 * the session signatures to use to authorize the user with the nodes
571571 */
@@ -574,7 +574,13 @@ export const JsonExecutionSdkParamsSchema = LitActionSdkParamsSchema.pick({
574574 * auth methods to resolve
575575 */
576576 authMethods : z . array ( AuthMethodSchema ) . optional ( ) ,
577- } ) ;
577+ } )
578+ . refine (
579+ ( data ) => ( data . code && ! data . ipfsId ) || ( ! data . code && data . ipfsId ) ,
580+ {
581+ message : 'Either `code` or `ipfsId` must be provided, but not both.' ,
582+ }
583+ ) ;
578584
579585export const SigResponseSchema = z . object ( {
580586 r : z . string ( ) ,
You can’t perform that action at this time.
0 commit comments