app_bridge 1.0.0-x86_64-linux-musl → 2.0.0-x86_64-linux-musl

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62231c9332eb45fa973d8eef9e1251fadca8b6150f7aa682bf4cd1d8cf9c1e66
4
- data.tar.gz: 6aade0b0cc781d72d0a0c0a987c570d8c55f23b85ebf5ced19f0eaebb35686aa
3
+ metadata.gz: 2dfd7b1a3d7c0eeccfab8c0c66bd11bf2de807ddf24f2366cbc8ff28e5a34876
4
+ data.tar.gz: fd5d3f61590a6b15c841dc039ddad8f0d157e6b7f2e91d3015f1375981a073e3
5
5
  SHA512:
6
- metadata.gz: ce586cc728704b8cdde398ef5220cefb25fea7e6a93c62df97858d180da3d43d197961fe3a592c715698d90c947c6dccb1604d9db2ac869d9c8cc0ab1dd0f694
7
- data.tar.gz: c0504101f6c2a94bac64dc26e41ed6bf3ef4c421e463cca527327fa6e0e14ada19ff23b4315fe8fed23fe0b2cd0222da612f81bbef79a2dea536f2672d46ccaa
6
+ metadata.gz: 596181651b83501fb0c2094f534bba2bbe7060c82c5af50db4545b984385ffbfaf2c41528a3458d544e1e81b1a0d7c178958327fc4703bd8f82fee24ec896607
7
+ data.tar.gz: 6ae909b246ab94b923d58ed94c6fd645be2298be60cdaed9c8a33674ca1f0302237412fba845da56106e2b24c17a3e2cd7def0bf728e2345db28e804e9b39049
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.4.2
@@ -1,4 +1,4 @@
1
- package standout:app@0.3.0;
1
+ package standout:app@2.0.0;
2
2
 
3
3
  interface types {
4
4
  // The trigger-store is a string that is used to store data between trigger
@@ -59,24 +59,62 @@ interface types {
59
59
  // ensure that the event is only triggered once per order update.
60
60
  id: string,
61
61
 
62
- // The timestamp of the event.
63
- // Must be a unix timestamp in milliseconds since epoch (UTC).
64
- // In JavaScript `Date.now()` can be used to get the current timestamp in
65
- // milliseconds.
66
- timestamp: u64,
67
-
68
62
  // Serialized data must be a JSON object serialized into a string
69
63
  // Note that it is important that the root is a object, not an array,
70
64
  // or another primitive type.
71
65
  serialized-data: string,
72
66
  }
67
+
68
+ /// A structured error that can be returned by for example a call to a trigger or action.
69
+ /// Contains a machine-readable code and a human-readable message.
70
+ record app-error {
71
+ /// The error code identifying the type of failure.
72
+ code: error-code,
73
+
74
+ /// A human-readable message describing the error in more detail.
75
+ message: string,
76
+ }
77
+
78
+ /// An enumeration of error codes that can be returned by a trigger implementation.
79
+ /// These codes help the platform and plugin developers distinguish between different types of failures.
80
+ variant error-code {
81
+ /// Authentication failed. Typically due to an invalid or expired API key or token.
82
+ unauthenticated,
83
+
84
+ /// Authorization failed. The account is valid but does not have the necessary permissions.
85
+ forbidden,
86
+
87
+ /// The trigger is misconfigured. For example, a required setting is missing or invalid.
88
+ misconfigured,
89
+
90
+ /// The target system does not support a required feature or endpoint.
91
+ unsupported,
92
+
93
+ /// The target system is rate-limiting requests. Try again later.
94
+ rate-limit,
95
+
96
+ /// The request timed out. The target system did not respond in time.
97
+ timeout,
98
+
99
+ /// The target system is currently unavailable or unreachable.
100
+ unavailable,
101
+
102
+ /// An unexpected internal error occurred in the plugin.
103
+ internal-error,
104
+
105
+ /// The response from the external system could not be parsed or was in an invalid format.
106
+ malformed-response,
107
+
108
+ /// A catch-all for all other types of errors. Should include a descriptive message.
109
+ other,
110
+ }
73
111
  }
74
112
 
75
113
 
76
114
  interface triggers {
77
- use types.{trigger-context, trigger-event, trigger-response};
115
+ use types.{trigger-context, trigger-event, trigger-response, app-error};
78
116
 
79
- get-triggers: func() -> list<string>;
117
+ trigger-ids: func() -> result<list<string>, app-error>;
80
118
 
81
119
  // Fetch events
82
120
  //
@@ -99,7 +137,7 @@ interface triggers {
99
137
  // the same events. That will ensure that the user that is building an
100
138
  // integration with your trigger will not miss any events if your system is
101
139
  // down for a short period of time.
102
- fetch-events: func(context: trigger-context) -> trigger-response;
140
+ fetch-events: func(context: trigger-context) -> result<trigger-response, app-error>;
103
141
  }
104
142
 
105
143
  interface http {
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppBridge
4
- VERSION = "1.0.0"
4
+ VERSION = "2.0.0"
5
5
  end
data/tasks/fixtures.rake CHANGED
@@ -2,36 +2,43 @@
2
2
 
3
3
  require "English"
4
4
 
5
- namespace :fixtures do
5
+ namespace :fixtures do # rubocop:disable Metrics/BlockLength
6
6
  namespace :apps do
7
7
  desc "Clean up build artifacts"
8
8
  task :clean do
9
- # In context of the path spec/fixtures/components/example.
9
+ # In context of the path spec/fixtures/components/rust_app.
10
10
  # Execute cargo clean.
11
11
  #
12
- pwd = "spec/fixtures/components/example"
12
+ pwd = "spec/fixtures/components/rust_app"
13
13
  pid = Process.spawn("cargo clean", chdir: pwd)
14
14
  Process.wait(pid)
15
15
  raise "Failed to clean build artifacts" unless $CHILD_STATUS.success?
16
16
 
17
17
  # Remove the built wasm artifact.
18
- pid = Process.spawn("rm example.wasm", chdir: "spec/fixtures/components")
18
+ pid = Process.spawn("rm rust_app.wasm", chdir: "spec/fixtures/components")
19
19
  Process.wait(pid)
20
20
  end
21
21
 
22
22
  desc "Compile the fixture apps"
23
- task :compile do
24
- pwd = "spec/fixtures/components/example"
23
+ task :compile_rust do
24
+ pwd = "spec/fixtures/components/rust_app"
25
25
  compile_pid = Process.spawn("cargo clean && cargo build --release --target wasm32-wasip2",
26
26
  chdir: pwd)
27
27
  Process.wait(compile_pid)
28
28
  raise "Failed to build artifacts" unless $CHILD_STATUS.success?
29
29
 
30
- move_pid = Process.spawn("mv #{pwd}/target/wasm32-wasip2/release/example.wasm #{pwd}/../example.wasm")
30
+ move_pid = Process.spawn("mv #{pwd}/target/wasm32-wasip2/release/rust_app.wasm #{pwd}/../rust_app.wasm")
31
31
  Process.wait(move_pid)
32
32
  end
33
+
34
+ task :compile_js do
35
+ pwd = "spec/fixtures/components/js_app"
36
+ pid = Process.spawn("npm run build", chdir: pwd)
37
+ Process.wait(pid)
38
+ raise "Failed to build artifacts" unless $CHILD_STATUS.success?
39
+ end
33
40
  end
34
41
  end
35
42
 
36
43
  desc "Build all fixtures"
37
- task fixtures: %i[fixtures:apps:clean fixtures:apps:compile]
44
+ task fixtures: %i[fixtures:apps:clean fixtures:apps:compile_rust fixtures:apps:compile_js]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_bridge
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: x86_64-linux-musl
6
6
  authors:
7
7
  - Alexander Ross
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-03 00:00:00.000000000 Z
11
+ date: 2025-04-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: The app_bridge gem is designed to enable seamless interaction with WebAssembly
14
14
  components that adhere to the WIT specification `standout:app`. It is developed
@@ -21,6 +21,7 @@ extra_rdoc_files: []
21
21
  files:
22
22
  - ".rspec"
23
23
  - ".rubocop.yml"
24
+ - ".tool-versions"
24
25
  - CHANGELOG.md
25
26
  - README.md
26
27
  - Rakefile