@vtxdeo/protocol 3.4.2 → 3.5.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.
- package/package.json +1 -1
- package/wit/vtx.wit +44 -1
package/package.json
CHANGED
package/wit/vtx.wit
CHANGED
|
@@ -72,6 +72,38 @@ interface types {
|
|
|
72
72
|
body: option<buffer>,
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
record http-client-request {
|
|
76
|
+
method: string,
|
|
77
|
+
url: string,
|
|
78
|
+
headers: list<tuple<string, string>>,
|
|
79
|
+
body: option<buffer>,
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
record http-client-response {
|
|
83
|
+
status: u16,
|
|
84
|
+
headers: list<tuple<string, string>>,
|
|
85
|
+
body: option<buffer>,
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
record http-allow-rule {
|
|
89
|
+
scheme: string,
|
|
90
|
+
host: string,
|
|
91
|
+
port: option<u16>,
|
|
92
|
+
path: option<string>,
|
|
93
|
+
methods: option<list<string>>,
|
|
94
|
+
allow-headers: option<list<string>>,
|
|
95
|
+
max-request-bytes: option<u64>,
|
|
96
|
+
max-response-bytes: option<u64>,
|
|
97
|
+
follow-redirects: option<bool>,
|
|
98
|
+
redirect-policy: option<string>,
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
record capabilities {
|
|
102
|
+
subscriptions: list<string>,
|
|
103
|
+
permissions: list<string>,
|
|
104
|
+
http: option<list<http-allow-rule>>,
|
|
105
|
+
}
|
|
106
|
+
|
|
75
107
|
record manifest {
|
|
76
108
|
id: string,
|
|
77
109
|
name: string,
|
|
@@ -125,8 +157,16 @@ interface event-bus {
|
|
|
125
157
|
) -> result<_, string>;
|
|
126
158
|
}
|
|
127
159
|
|
|
160
|
+
interface http-client {
|
|
161
|
+
use types.{http-client-request, http-client-response};
|
|
162
|
+
|
|
163
|
+
request: func(
|
|
164
|
+
req: http-client-request,
|
|
165
|
+
) -> result<http-client-response, string>;
|
|
166
|
+
}
|
|
167
|
+
|
|
128
168
|
world plugin {
|
|
129
|
-
use types.{http-request, http-response, manifest};
|
|
169
|
+
use types.{capabilities, http-request, http-response, manifest};
|
|
130
170
|
use auth-types.{user-context};
|
|
131
171
|
use events.{vtx-event};
|
|
132
172
|
|
|
@@ -135,6 +175,7 @@ world plugin {
|
|
|
135
175
|
import ffmpeg;
|
|
136
176
|
import context;
|
|
137
177
|
import event-bus;
|
|
178
|
+
import http-client;
|
|
138
179
|
|
|
139
180
|
export handle: func(
|
|
140
181
|
req: http-request,
|
|
@@ -150,6 +191,8 @@ world plugin {
|
|
|
150
191
|
|
|
151
192
|
export get-resources: func() -> list<string>;
|
|
152
193
|
|
|
194
|
+
export get-capabilities: func() -> capabilities;
|
|
195
|
+
|
|
153
196
|
export authenticate: func(
|
|
154
197
|
headers: list<tuple<string, string>>,
|
|
155
198
|
) -> result<user-context, u16>;
|