app_bridge 2.0.1 → 2.1.1

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,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # When updating the version, please also update the version in the
4
+ # ext/app_bridge/Cargo.toml file to keep them in sync.
5
+
3
6
  module AppBridge
4
- VERSION = "2.0.1"
7
+ VERSION = "2.1.1"
5
8
  end
data/lib/app_bridge.rb CHANGED
@@ -3,17 +3,12 @@
3
3
  require_relative "app_bridge/version"
4
4
  require_relative "app_bridge/app"
5
5
 
6
- begin
7
- require "app_bridge/#{RUBY_VERSION.split(".").first(2).join(".")}/app_bridge"
8
- rescue LoadError
9
- require "app_bridge/app_bridge"
10
- end
11
-
12
6
  module AppBridge
13
7
  class Error < StandardError; end
14
8
  class TimeoutError < Error; end
15
9
  class TooManyEventsError < Error; end
16
10
  class StoreTooLargeError < Error; end
11
+ class ActionResponseTooLargeError < Error; end
17
12
 
18
13
  # Represents a trigger event that is recieved from the app.
19
14
  class TriggerEvent
@@ -23,3 +18,10 @@ module AppBridge
23
18
  end
24
19
  end
25
20
  end
21
+
22
+ # Load using the Ruby version as the directory name
23
+ begin
24
+ require "app_bridge/#{RUBY_VERSION.split(".").first(2).join(".")}/app_bridge"
25
+ rescue LoadError
26
+ require "app_bridge/app_bridge"
27
+ end
data/sig/app_bridge.rbs CHANGED
@@ -7,11 +7,15 @@ module AppBridge
7
7
 
8
8
  def triggers: () -> Array[String]
9
9
 
10
+ def actions: () -> Array[String]
11
+
10
12
  def fetch_events: (TriggerContext) -> TriggerResponse
13
+
14
+ def execute_action: (ActionContext) -> ActionResponse
11
15
  end
12
16
 
13
- class Account
14
- def self.new: (String, String, String) -> Account
17
+ class Connection
18
+ def self.new: (String, String, String) -> Connection
15
19
 
16
20
  def id: () -> String
17
21
 
@@ -39,12 +43,30 @@ module AppBridge
39
43
  end
40
44
 
41
45
  class TriggerContext
42
- def self.new: (String, Account, String) -> TriggerContext
46
+ def self.new: (String, Connection, String, String) -> TriggerContext
43
47
 
44
48
  def trigger_id: () -> String
45
49
 
46
- def account: () -> Account
50
+ def connection: () -> Connection
47
51
 
48
52
  def store: () -> String
53
+
54
+ def serialized_input: () -> String
55
+ end
56
+
57
+ class ActionContext
58
+ def self.new: (String, Connection, String) -> ActionContext
59
+
60
+ def action_id: () -> String
61
+
62
+ def connection: () -> Connection
63
+
64
+ def serialized_input: () -> String
65
+ end
66
+
67
+ class ActionResponse
68
+ def self.new: (String) -> ActionResponse
69
+
70
+ def serialized_output: () -> String
49
71
  end
50
72
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Rake task to run Rust tests
4
+ namespace :rust do
5
+ desc "Run Rust tests"
6
+ task :test do
7
+ puts "Running Rust tests..."
8
+ system("cargo test")
9
+ puts "Rust tests completed."
10
+ end
11
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_bridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Ross
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-14 00:00:00.000000000 Z
10
+ date: 2025-10-03 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rb_sys
@@ -33,6 +33,7 @@ extensions:
33
33
  - ext/app_bridge/extconf.rb
34
34
  extra_rdoc_files: []
35
35
  files:
36
+ - ".editorconfig"
36
37
  - ".rspec"
37
38
  - ".rubocop.yml"
38
39
  - ".tool-versions"
@@ -48,8 +49,10 @@ files:
48
49
  - ext/app_bridge/src/error_mapping.rs
49
50
  - ext/app_bridge/src/lib.rs
50
51
  - ext/app_bridge/src/request_builder.rs
51
- - ext/app_bridge/src/wrappers/account.rs
52
+ - ext/app_bridge/src/wrappers/action_context.rs
53
+ - ext/app_bridge/src/wrappers/action_response.rs
52
54
  - ext/app_bridge/src/wrappers/app.rs
55
+ - ext/app_bridge/src/wrappers/connection.rs
53
56
  - ext/app_bridge/src/wrappers/mod.rs
54
57
  - ext/app_bridge/src/wrappers/trigger_context.rs
55
58
  - ext/app_bridge/src/wrappers/trigger_event.rs
@@ -60,6 +63,7 @@ files:
60
63
  - lib/app_bridge/version.rb
61
64
  - sig/app_bridge.rbs
62
65
  - tasks/fixtures.rake
66
+ - tasks/rust_test.rake
63
67
  homepage: https://github.com/standout/app_bridge
64
68
  licenses: []
65
69
  metadata: