app_bridge 3.0.0 → 4.1.0

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.
@@ -1,5 +1,5 @@
1
- use magnus::{prelude::*, Error, TryConvert, Value};
2
- use crate::component::standout::app::types::ActionContext;
1
+ use magnus::{prelude::*, scan_args::scan_args, Error, RHash, Ruby, Symbol, TryConvert, Value};
2
+ use crate::types::{ActionContext, ReferenceObject};
3
3
  use super::connection::RConnection;
4
4
 
5
5
  #[magnus::wrap(class = "AppBridge::ActionContext")]
@@ -9,7 +9,29 @@ pub struct RActionContext {
9
9
  }
10
10
 
11
11
  impl RActionContext {
12
- pub fn new(action_id: String, connection: Value, serialized_input: String) -> Result<Self, Error> {
12
+ fn parse_reference_object(value: Value) -> Result<ReferenceObject, Error> {
13
+ let reference: String = fetch_hash_string(value, "reference")?;
14
+ let status: String = fetch_hash_string(value, "status")?;
15
+ Ok(ReferenceObject {
16
+ reference,
17
+ status,
18
+ })
19
+ }
20
+
21
+ pub fn new(args: &[Value]) -> Result<Self, Error> {
22
+ let args = scan_args::<(String, Value, String), (Option<Value>,), (), (), (), ()>(args)?;
23
+ let (action_id, connection, serialized_input) = args.required;
24
+ let (retry,) = args.optional;
25
+
26
+ Self::build(action_id, connection, serialized_input, retry)
27
+ }
28
+
29
+ fn build(
30
+ action_id: String,
31
+ connection: Value,
32
+ serialized_input: String,
33
+ retry: Option<Value>,
34
+ ) -> Result<Self, Error> {
13
35
  if connection.is_nil() {
14
36
  return Err(Error::new(magnus::exception::runtime_error(), "Connection is required"));
15
37
  }
@@ -19,14 +41,18 @@ impl RActionContext {
19
41
  Err(_) => return Err(Error::new(magnus::exception::runtime_error(), "Connection is required")),
20
42
  };
21
43
 
22
- let inner = ActionContext {
23
- action_id: action_id,
24
- connection: wrapped_connection.clone().into(),
25
- serialized_input,
44
+ let reference_object = match retry {
45
+ Some(value) if !value.is_nil() => Some(Self::parse_reference_object(value)?),
46
+ _ => None,
26
47
  };
27
48
 
28
49
  Ok(Self {
29
- inner,
50
+ inner: ActionContext {
51
+ action_id,
52
+ connection: wrapped_connection.clone().into(),
53
+ serialized_input,
54
+ reference_object,
55
+ },
30
56
  wrapped_connection: Some(wrapped_connection),
31
57
  })
32
58
  }
@@ -42,6 +68,18 @@ impl RActionContext {
42
68
  pub fn serialized_input(&self) -> String {
43
69
  self.inner.serialized_input.clone()
44
70
  }
71
+
72
+ pub fn reference_object(&self) -> Result<Value, Error> {
73
+ let ruby = Ruby::get().unwrap();
74
+ if let Some(reference_object) = &self.inner.reference_object {
75
+ let hash: RHash = ruby.hash_new();
76
+ hash.aset("reference", reference_object.reference.clone())?;
77
+ hash.aset("status", reference_object.status.clone())?;
78
+ Ok(hash.as_value())
79
+ } else {
80
+ Ok(ruby.qnil().as_value())
81
+ }
82
+ }
45
83
  }
46
84
 
47
85
  impl TryConvert for RActionContext {
@@ -49,6 +87,16 @@ impl TryConvert for RActionContext {
49
87
  let connection_val: Value = val.funcall("connection", ())?;
50
88
  let serialized_input: String = val.funcall("serialized_input", ())?;
51
89
  let action_id: String = val.funcall("action_id", ())?;
90
+ let reference_object = if val.funcall("respond_to?", ("reference_object",))? {
91
+ let reference_object_val: Value = val.funcall("reference_object", ())?;
92
+ if reference_object_val.is_nil() {
93
+ None
94
+ } else {
95
+ Some(Self::parse_reference_object(reference_object_val)?)
96
+ }
97
+ } else {
98
+ None
99
+ };
52
100
 
53
101
  if connection_val.is_nil() {
54
102
  return Err(Error::new(magnus::exception::runtime_error(), "Connection is required"));
@@ -60,9 +108,10 @@ impl TryConvert for RActionContext {
60
108
  };
61
109
 
62
110
  let inner = ActionContext {
63
- action_id: action_id,
111
+ action_id,
64
112
  connection: wrapped_connection.clone().inner,
65
113
  serialized_input,
114
+ reference_object,
66
115
  };
67
116
 
68
117
  Ok(Self {
@@ -72,6 +121,18 @@ impl TryConvert for RActionContext {
72
121
  }
73
122
  }
74
123
 
124
+ fn fetch_hash_string(hash: Value, key: &str) -> Result<String, Error> {
125
+ let value: Value = hash.funcall("[]", (key,))?;
126
+ let value = if value.is_nil() {
127
+ let symbol = Symbol::new(key);
128
+ hash.funcall("[]", (symbol,))?
129
+ } else {
130
+ value
131
+ };
132
+ TryConvert::try_convert(value)
133
+ }
134
+
135
+
75
136
  impl From<RActionContext> for ActionContext {
76
137
  fn from(raction_context: RActionContext) -> Self {
77
138
  raction_context.inner
@@ -1,4 +1,4 @@
1
- use crate::component::standout::app::types::ActionResponse;
1
+ use crate::types::ActionResponse;
2
2
 
3
3
  #[magnus::wrap(class = "AppBridge::ActionResponse")]
4
4
  pub struct RActionResponse {
@@ -8,7 +8,7 @@ pub struct RActionResponse {
8
8
  impl RActionResponse {
9
9
  pub fn new(serialized_output: String) -> Self {
10
10
  let inner = ActionResponse {
11
- serialized_output: serialized_output,
11
+ serialized_output,
12
12
  };
13
13
  Self { inner }
14
14
  }
@@ -16,6 +16,11 @@ impl RActionResponse {
16
16
  pub fn serialized_output(&self) -> String {
17
17
  self.inner.serialized_output.clone()
18
18
  }
19
+
20
+ /// Returns a new ActionResponse with the given output
21
+ pub fn with_output(&self, value: String) -> Self {
22
+ Self::new(value)
23
+ }
19
24
  }
20
25
 
21
26
  impl From<ActionResponse> for RActionResponse {
@@ -29,4 +34,3 @@ impl From<RActionResponse> for ActionResponse {
29
34
  value.inner
30
35
  }
31
36
  }
32
-
@@ -4,21 +4,19 @@ use std::collections::HashMap;
4
4
  use wasmtime::Store;
5
5
 
6
6
  use crate::app_state::AppState;
7
- use crate::component::standout::app::types::{
8
- AppError, ErrorCode, TriggerContext, TriggerResponse, ActionContext, ActionResponse
9
- };
10
- use crate::component::{app, build_engine, build_linker, build_store, Bridge};
7
+ use crate::component::{app, build_engine, build_linker, build_store, BridgeWrapper};
8
+ use crate::types::{ActionContext, ActionResponse, AppError, ErrorCode, TriggerContext, TriggerResponse};
11
9
  use super::{
12
- trigger_context::RTriggerContext,
13
- trigger_response::RTriggerResponse,
14
10
  action_context::RActionContext,
15
11
  action_response::RActionResponse,
12
+ trigger_context::RTriggerContext,
13
+ trigger_response::RTriggerResponse,
16
14
  };
17
15
 
18
16
  #[derive(Default)]
19
17
  pub struct RApp {
20
18
  component_path: String,
21
- instance: RefCell<Option<Bridge>>,
19
+ instance: RefCell<Option<BridgeWrapper>>,
22
20
  store: RefCell<Option<Store<AppState>>>,
23
21
  }
24
22
 
@@ -27,13 +25,28 @@ pub struct RApp {
27
25
  pub struct MutRApp(RefCell<RApp>);
28
26
 
29
27
  impl MutRApp {
28
+ /// Returns the WIT version this component was built against (e.g., "3.0.0", "4.0.0")
29
+ pub fn wit_version(&self) -> Result<String, Error> {
30
+ let binding = self.0.borrow();
31
+ let instance = binding.instance.borrow();
32
+
33
+ if let Some(instance) = &*instance {
34
+ Ok(instance.wit_version().to_string())
35
+ } else {
36
+ Err(Error::new(
37
+ magnus::exception::runtime_error(),
38
+ "App not initialized",
39
+ ))
40
+ }
41
+ }
42
+
30
43
  pub fn initialize(&self, component_path: String, env_vars: HashMap<String, String>) -> Result<(), Error> {
31
44
  let mut this = self.0.borrow_mut();
32
45
  let engine = build_engine();
33
46
  let linker = build_linker(&engine).map_err(|e| {
34
47
  Error::new(
35
48
  magnus::exception::runtime_error(),
36
- format!("Failed to build linker: {}", e)
49
+ format!("Failed to build linker: {}", e),
37
50
  )
38
51
  })?;
39
52
  let mut store = if env_vars.is_empty() {
@@ -44,19 +57,16 @@ impl MutRApp {
44
57
 
45
58
  let app = app(component_path.clone(), engine, &mut store, linker).map_err(|e| {
46
59
  if e.to_string().contains("Incompatible WASM file version") {
47
- Error::new(
48
- magnus::exception::runtime_error(),
49
- e.to_string()
50
- )
60
+ Error::new(magnus::exception::runtime_error(), e.to_string())
51
61
  } else {
52
62
  Error::new(
53
63
  magnus::exception::runtime_error(),
54
- format!("Failed to initialize app: {}", e)
64
+ format!("Failed to initialize app: {}", e),
55
65
  )
56
66
  }
57
67
  })?;
58
68
 
59
- this.component_path = component_path.to_string();
69
+ this.component_path = component_path;
60
70
  *this.instance.borrow_mut() = Some(app);
61
71
  *this.store.borrow_mut() = Some(store);
62
72
 
@@ -65,102 +75,87 @@ impl MutRApp {
65
75
 
66
76
  pub fn trigger_ids(&self) -> Result<Vec<String>, Error> {
67
77
  let binding = self.0.borrow();
68
-
69
78
  let mut instance = binding.instance.borrow_mut();
70
79
  let mut store = binding.store.borrow_mut();
71
80
 
72
81
  if let (Some(instance), Some(store)) = (&mut *instance, &mut *store) {
73
- match instance.standout_app_triggers().call_trigger_ids(store) {
74
- Ok(result) => {
75
- match result {
76
- Ok(ids) => Ok(ids),
77
- Err(err) => Err(err.into())
78
- }
79
- },
82
+ match instance.call_trigger_ids(store) {
83
+ Ok(result) => result.map_err(Into::into),
80
84
  Err(err) => {
81
- if let Some(wit_err) = err.downcast_ref::<AppError>() {
82
- Err(wit_err.clone().into())
83
- } else {
84
- Err(Error::new(
85
- magnus::exception::runtime_error(),
86
- format!("Unexpected error: {:?}", err)
87
- ))
88
- }
89
- },
85
+ if let Some(wit_err) = err.downcast_ref::<AppError>() {
86
+ Err(wit_err.clone().into())
87
+ } else {
88
+ Err(Error::new(
89
+ magnus::exception::runtime_error(),
90
+ format!("Unexpected error: {:?}", err),
91
+ ))
92
+ }
93
+ }
90
94
  }
91
95
  } else {
92
96
  Err(AppError {
93
97
  code: ErrorCode::InternalError,
94
98
  message: "App instance couldn't be initialized".to_string(),
95
- }.into())
99
+ }
100
+ .into())
96
101
  }
97
102
  }
98
103
 
99
104
  pub fn trigger_input_schema(&self, context: RTriggerContext) -> Result<String, Error> {
100
105
  let binding = self.0.borrow();
101
-
102
106
  let mut instance = binding.instance.borrow_mut();
103
107
  let mut store = binding.store.borrow_mut();
104
108
 
105
109
  if let (Some(instance), Some(store)) = (&mut *instance, &mut *store) {
106
110
  let context_ctx = context.into();
107
- match instance.standout_app_triggers().call_input_schema(store, &context_ctx) {
108
- Ok(result) => {
109
- match result {
110
- Ok(schema) => Ok(schema),
111
- Err(err) => Err(err.into())
112
- }
113
- },
111
+ match instance.call_trigger_input_schema(store, &context_ctx) {
112
+ Ok(result) => result.map_err(Into::into),
114
113
  Err(err) => {
115
- if let Some(wit_err) = err.downcast_ref::<AppError>() {
116
- Err(wit_err.clone().into())
117
- } else {
118
- Err(Error::new(
119
- magnus::exception::runtime_error(),
120
- format!("Unexpected error: {:?}", err)
121
- ))
122
- }
123
- },
114
+ if let Some(wit_err) = err.downcast_ref::<AppError>() {
115
+ Err(wit_err.clone().into())
116
+ } else {
117
+ Err(Error::new(
118
+ magnus::exception::runtime_error(),
119
+ format!("Unexpected error: {:?}", err),
120
+ ))
121
+ }
122
+ }
124
123
  }
125
124
  } else {
126
125
  Err(AppError {
127
126
  code: ErrorCode::InternalError,
128
127
  message: "App instance couldn't be initialized".to_string(),
129
- }.into())
128
+ }
129
+ .into())
130
130
  }
131
131
  }
132
132
 
133
133
  pub fn trigger_output_schema(&self, context: RTriggerContext) -> Result<String, Error> {
134
134
  let binding = self.0.borrow();
135
-
136
135
  let mut instance = binding.instance.borrow_mut();
137
136
  let mut store = binding.store.borrow_mut();
138
137
 
139
138
  if let (Some(instance), Some(store)) = (&mut *instance, &mut *store) {
140
139
  let context_ctx = context.into();
141
- match instance.standout_app_triggers().call_output_schema(store, &context_ctx) {
142
- Ok(result) => {
143
- match result {
144
- Ok(schema) => Ok(schema),
145
- Err(err) => Err(err.into())
146
- }
147
- },
140
+ match instance.call_trigger_output_schema(store, &context_ctx) {
141
+ Ok(result) => result.map_err(Into::into),
148
142
  Err(err) => {
149
- if let Some(wit_err) = err.downcast_ref::<AppError>() {
150
- Err(wit_err.clone().into())
151
- } else {
152
- Err(Error::new(
153
- magnus::exception::runtime_error(),
154
- format!("Unexpected error: {:?}", err)
155
- ))
156
- }
157
- },
143
+ if let Some(wit_err) = err.downcast_ref::<AppError>() {
144
+ Err(wit_err.clone().into())
145
+ } else {
146
+ Err(Error::new(
147
+ magnus::exception::runtime_error(),
148
+ format!("Unexpected error: {:?}", err),
149
+ ))
150
+ }
151
+ }
158
152
  }
159
153
  } else {
160
154
  Err(AppError {
161
155
  code: ErrorCode::InternalError,
162
156
  message: "App instance couldn't be initialized".to_string(),
163
- }.into())
157
+ }
158
+ .into())
164
159
  }
165
160
  }
166
161
 
@@ -169,30 +164,22 @@ impl MutRApp {
169
164
  let response = self.fetch_events(context.into());
170
165
 
171
166
  match response {
172
- Ok(response) => Ok(response.into()),
173
- Err(err) => Err(err.into())
167
+ Ok(response) => Ok(response.into()),
168
+ Err(err) => Err(err.into()),
174
169
  }
175
170
  }
176
171
 
177
172
  fn fetch_events(&self, context: TriggerContext) -> Result<TriggerResponse, AppError> {
178
173
  let binding = self.0.borrow();
179
-
180
174
  let mut instance = binding.instance.borrow_mut();
181
175
  let mut store = binding.store.borrow_mut();
182
176
 
183
177
  if let (Some(instance), Some(store)) = (&mut *instance, &mut *store) {
184
- match instance
185
- .standout_app_triggers()
186
- .call_fetch_events(store, &context) {
187
- Ok(response) => {
188
- match response {
189
- Ok(res) => Ok(res),
190
- Err(err) => Err(err),
191
- }
192
- },
178
+ match instance.call_fetch_events(store, &context) {
179
+ Ok(response) => response,
193
180
  Err(err) => {
194
181
  if let Some(wit_err) = err.downcast_ref::<AppError>() {
195
- Err(AppError::from(wit_err.clone()))
182
+ Err(wit_err.clone())
196
183
  } else {
197
184
  Err(AppError {
198
185
  code: ErrorCode::InternalError,
@@ -211,102 +198,87 @@ impl MutRApp {
211
198
 
212
199
  pub fn action_ids(&self) -> Result<Vec<String>, Error> {
213
200
  let binding = self.0.borrow();
214
-
215
201
  let mut instance = binding.instance.borrow_mut();
216
202
  let mut store = binding.store.borrow_mut();
217
203
 
218
204
  if let (Some(instance), Some(store)) = (&mut *instance, &mut *store) {
219
- match instance.standout_app_actions().call_action_ids(store) {
220
- Ok(result) => {
221
- match result {
222
- Ok(ids) => Ok(ids),
223
- Err(err) => Err(err.into())
224
- }
225
- },
205
+ match instance.call_action_ids(store) {
206
+ Ok(result) => result.map_err(Into::into),
226
207
  Err(err) => {
227
- if let Some(wit_err) = err.downcast_ref::<AppError>() {
228
- Err(wit_err.clone().into())
229
- } else {
230
- Err(Error::new(
231
- magnus::exception::runtime_error(),
232
- format!("Unexpected error: {:?}", err)
233
- ))
234
- }
235
- },
208
+ if let Some(wit_err) = err.downcast_ref::<AppError>() {
209
+ Err(wit_err.clone().into())
210
+ } else {
211
+ Err(Error::new(
212
+ magnus::exception::runtime_error(),
213
+ format!("Unexpected error: {:?}", err),
214
+ ))
215
+ }
216
+ }
236
217
  }
237
218
  } else {
238
219
  Err(AppError {
239
220
  code: ErrorCode::InternalError,
240
221
  message: "App instance couldn't be initialized".to_string(),
241
- }.into())
222
+ }
223
+ .into())
242
224
  }
243
225
  }
244
226
 
245
227
  pub fn action_input_schema(&self, context: RActionContext) -> Result<String, Error> {
246
228
  let binding = self.0.borrow();
247
-
248
229
  let mut instance = binding.instance.borrow_mut();
249
230
  let mut store = binding.store.borrow_mut();
250
231
 
251
232
  if let (Some(instance), Some(store)) = (&mut *instance, &mut *store) {
252
233
  let context_ctx = context.into();
253
- match instance.standout_app_actions().call_input_schema(store, &context_ctx) {
254
- Ok(result) => {
255
- match result {
256
- Ok(schema) => Ok(schema),
257
- Err(err) => Err(err.into())
258
- }
259
- },
234
+ match instance.call_action_input_schema(store, &context_ctx) {
235
+ Ok(result) => result.map_err(Into::into),
260
236
  Err(err) => {
261
- if let Some(wit_err) = err.downcast_ref::<AppError>() {
262
- Err(wit_err.clone().into())
263
- } else {
264
- Err(Error::new(
265
- magnus::exception::runtime_error(),
266
- format!("Unexpected error: {:?}", err)
267
- ))
268
- }
269
- },
237
+ if let Some(wit_err) = err.downcast_ref::<AppError>() {
238
+ Err(wit_err.clone().into())
239
+ } else {
240
+ Err(Error::new(
241
+ magnus::exception::runtime_error(),
242
+ format!("Unexpected error: {:?}", err),
243
+ ))
244
+ }
245
+ }
270
246
  }
271
247
  } else {
272
248
  Err(AppError {
273
249
  code: ErrorCode::InternalError,
274
250
  message: "App instance couldn't be initialized".to_string(),
275
- }.into())
251
+ }
252
+ .into())
276
253
  }
277
254
  }
278
255
 
279
256
  pub fn action_output_schema(&self, context: RActionContext) -> Result<String, Error> {
280
257
  let binding = self.0.borrow();
281
-
282
258
  let mut instance = binding.instance.borrow_mut();
283
259
  let mut store = binding.store.borrow_mut();
284
260
 
285
261
  if let (Some(instance), Some(store)) = (&mut *instance, &mut *store) {
286
262
  let context_ctx = context.into();
287
- match instance.standout_app_actions().call_output_schema(store, &context_ctx) {
288
- Ok(result) => {
289
- match result {
290
- Ok(schema) => Ok(schema),
291
- Err(err) => Err(err.into())
292
- }
293
- },
263
+ match instance.call_action_output_schema(store, &context_ctx) {
264
+ Ok(result) => result.map_err(Into::into),
294
265
  Err(err) => {
295
- if let Some(wit_err) = err.downcast_ref::<AppError>() {
296
- Err(wit_err.clone().into())
297
- } else {
298
- Err(Error::new(
299
- magnus::exception::runtime_error(),
300
- format!("Unexpected error: {:?}", err)
301
- ))
302
- }
303
- },
266
+ if let Some(wit_err) = err.downcast_ref::<AppError>() {
267
+ Err(wit_err.clone().into())
268
+ } else {
269
+ Err(Error::new(
270
+ magnus::exception::runtime_error(),
271
+ format!("Unexpected error: {:?}", err),
272
+ ))
273
+ }
274
+ }
304
275
  }
305
276
  } else {
306
277
  Err(AppError {
307
278
  code: ErrorCode::InternalError,
308
279
  message: "App instance couldn't be initialized".to_string(),
309
- }.into())
280
+ }
281
+ .into())
310
282
  }
311
283
  }
312
284
 
@@ -315,30 +287,22 @@ impl MutRApp {
315
287
  let response = self.execute_action(context.into());
316
288
 
317
289
  match response {
318
- Ok(response) => Ok(response.into()),
319
- Err(err) => Err(err.into())
290
+ Ok(response) => Ok(response.into()),
291
+ Err(err) => Err(err.into()),
320
292
  }
321
293
  }
322
294
 
323
295
  fn execute_action(&self, context: ActionContext) -> Result<ActionResponse, AppError> {
324
296
  let binding = self.0.borrow();
325
-
326
297
  let mut instance = binding.instance.borrow_mut();
327
298
  let mut store = binding.store.borrow_mut();
328
299
 
329
300
  if let (Some(instance), Some(store)) = (&mut *instance, &mut *store) {
330
- match instance
331
- .standout_app_actions()
332
- .call_execute(store, &context) {
333
- Ok(response) => {
334
- match response {
335
- Ok(res) => Ok(res),
336
- Err(err) => Err(err),
337
- }
338
- },
301
+ match instance.call_execute(store, &context) {
302
+ Ok(response) => response,
339
303
  Err(err) => {
340
304
  if let Some(wit_err) = err.downcast_ref::<AppError>() {
341
- Err(AppError::from(wit_err.clone()))
305
+ Err(wit_err.clone())
342
306
  } else {
343
307
  Err(AppError {
344
308
  code: ErrorCode::InternalError,
@@ -1,5 +1,5 @@
1
1
  use magnus::{prelude::*, Error, TryConvert, Value};
2
- use crate::component::standout::app::types::Connection;
2
+ use crate::types::Connection;
3
3
 
4
4
  #[magnus::wrap(class = "AppBridge::Connection")]
5
5
  pub struct RConnection {
@@ -9,9 +9,9 @@ pub struct RConnection {
9
9
  impl RConnection {
10
10
  pub fn new(id: String, name: String, serialized_data: String) -> Self {
11
11
  let inner = Connection {
12
- id: id,
13
- name: name,
14
- serialized_data: serialized_data,
12
+ id,
13
+ name,
14
+ serialized_data,
15
15
  };
16
16
  Self { inner }
17
17
  }
@@ -1,5 +1,5 @@
1
1
  use magnus::{prelude::*, Error, TryConvert, Value};
2
- use crate::component::standout::app::types::TriggerContext;
2
+ use crate::types::TriggerContext;
3
3
  use super::connection::RConnection;
4
4
 
5
5
  #[magnus::wrap(class = "AppBridge::TriggerContext")]
@@ -20,10 +20,10 @@ impl RTriggerContext {
20
20
  };
21
21
 
22
22
  let inner = TriggerContext {
23
- trigger_id: trigger_id,
23
+ trigger_id,
24
24
  connection: wrapped_connection.clone().into(),
25
- store: store,
26
- serialized_input: serialized_input,
25
+ store,
26
+ serialized_input,
27
27
  };
28
28
  Ok(Self {
29
29
  inner,
@@ -65,10 +65,10 @@ impl TryConvert for RTriggerContext {
65
65
  };
66
66
 
67
67
  let inner = TriggerContext {
68
- trigger_id: trigger_id,
68
+ trigger_id,
69
69
  connection: wrapped_connection.clone().inner,
70
- store: store,
71
- serialized_input: serialized_input,
70
+ store,
71
+ serialized_input,
72
72
  };
73
73
 
74
74
  Ok(Self {
@@ -1,5 +1,5 @@
1
1
  use magnus::{prelude::*, Error, TryConvert, Value};
2
- use crate::component::standout::app::types::TriggerEvent;
2
+ use crate::types::TriggerEvent;
3
3
 
4
4
  #[magnus::wrap(class = "AppBridge::TriggerEvent")]
5
5
  pub struct RTriggerEvent {
@@ -8,9 +8,9 @@ pub struct RTriggerEvent {
8
8
 
9
9
  impl RTriggerEvent {
10
10
  pub fn new(id: String, serialized_data: String) -> Self {
11
- let inner: TriggerEvent = TriggerEvent {
12
- id: id,
13
- serialized_data: serialized_data,
11
+ let inner = TriggerEvent {
12
+ id,
13
+ serialized_data,
14
14
  };
15
15
  Self { inner }
16
16
  }