File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -291,6 +291,23 @@ public class HaystackClient {
291291 return try await post ( path: " watchPoll " , grid: builder. toGrid ( ) )
292292 }
293293
294+ public func invokeAction( id: Ref , action: String , args: [ String : any Val ] ) async throws -> Grid {
295+ let gridMeta : [ String : any Val ] = [
296+ " id " : id,
297+ " action " : action
298+ ]
299+ let builder = GridBuilder ( )
300+ builder. setMeta ( gridMeta)
301+ var row = [ any Val ] ( )
302+ for (argName, argVal) in args {
303+ try builder. addCol ( name: argName)
304+ row. append ( argVal)
305+ }
306+ try builder. addRow ( row)
307+
308+ return try await post ( path: " invokeAction " , grid: builder. toGrid ( ) )
309+ }
310+
294311 @discardableResult
295312 private func post( path: String , args: [ String : any Val ] = [ : ] ) async throws -> Grid {
296313 let grid : Grid
You can’t perform that action at this time.
0 commit comments