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 +4 -4
- data/.tool-versions +1 -0
- data/ext/app_bridge/wit/world.wit +48 -10
- data/lib/app_bridge/3.2/app_bridge.so +0 -0
- data/lib/app_bridge/3.4/app_bridge.so +0 -0
- data/lib/app_bridge/version.rb +1 -1
- data/tasks/fixtures.rake +15 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dfd7b1a3d7c0eeccfab8c0c66bd11bf2de807ddf24f2366cbc8ff28e5a34876
|
4
|
+
data.tar.gz: fd5d3f61590a6b15c841dc039ddad8f0d157e6b7f2e91d3015f1375981a073e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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
|
data/lib/app_bridge/version.rb
CHANGED
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/
|
9
|
+
# In context of the path spec/fixtures/components/rust_app.
|
10
10
|
# Execute cargo clean.
|
11
11
|
#
|
12
|
-
pwd = "spec/fixtures/components/
|
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
|
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 :
|
24
|
-
pwd = "spec/fixtures/components/
|
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/
|
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:
|
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:
|
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-
|
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
|