@vtxdeo/protocol 3.6.0 → 5.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/wit/vtx.wit +49 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxdeo/protocol",
3
- "version": "3.6.0",
3
+ "version": "5.0.0",
4
4
  "description": "WIT interface definitions for VTX plugins",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/wit/vtx.wit CHANGED
@@ -1,6 +1,6 @@
1
1
  package vtx:api@1.2.6;
2
2
 
3
- interface sql {
3
+ interface vtx-sql {
4
4
  variant db-value {
5
5
  text(string),
6
6
  integer(s64),
@@ -19,7 +19,7 @@ interface sql {
19
19
  ) -> result<string, string>;
20
20
  }
21
21
 
22
- interface stream-io {
22
+ interface vtx-vfs {
23
23
  resource buffer {
24
24
  size: func() -> u64;
25
25
 
@@ -33,16 +33,37 @@ interface stream-io {
33
33
  ) -> u64;
34
34
  }
35
35
 
36
- open-file: func(
37
- uuid: string,
38
- ) -> result<buffer, string>;
36
+ record vtx-object-meta {
37
+ uri: string,
38
+ size: u64,
39
+ last-modified: option<s64>,
40
+ etag: option<string>,
41
+ }
39
42
 
40
43
  create-memory-buffer: func(
41
44
  data: list<u8>,
42
45
  ) -> buffer;
46
+
47
+ open-uri: func(
48
+ uri: string,
49
+ ) -> result<buffer, string>;
50
+
51
+ head: func(
52
+ uri: string,
53
+ ) -> result<vtx-object-meta, string>;
54
+
55
+ list-objects: func(
56
+ prefix-uri: string,
57
+ ) -> result<list<vtx-object-meta>, string>;
58
+
59
+ read-range: func(
60
+ uri: string,
61
+ offset: u64,
62
+ len: u64,
63
+ ) -> result<list<u8>, string>;
43
64
  }
44
65
 
45
- interface auth-types {
66
+ interface vtx-auth-types {
46
67
  record user-context {
47
68
  user-id: string,
48
69
  username: string,
@@ -57,9 +78,9 @@ interface auth-types {
57
78
  }
58
79
  }
59
80
 
60
- interface types {
61
- use stream-io.{buffer};
62
- use auth-types.{user-context};
81
+ interface vtx-types {
82
+ use vtx-vfs.{buffer};
83
+ use vtx-auth-types.{user-context};
63
84
 
64
85
  record http-request {
65
86
  method: string,
@@ -113,8 +134,8 @@ interface types {
113
134
  }
114
135
  }
115
136
 
116
- interface ffmpeg {
117
- use stream-io.{buffer};
137
+ interface vtx-ffmpeg {
138
+ use vtx-vfs.{buffer};
118
139
 
119
140
  record ffmpeg-option {
120
141
  key: string,
@@ -132,7 +153,7 @@ interface ffmpeg {
132
153
  ) -> result<buffer, string>;
133
154
  }
134
155
 
135
- interface events {
156
+ interface vtx-events {
136
157
  record event-context {
137
158
  user-id: option<string>,
138
159
  username: option<string>,
@@ -149,38 +170,38 @@ interface events {
149
170
  }
150
171
  }
151
172
 
152
- interface context {
153
- use auth-types.{current-user};
173
+ interface vtx-context {
174
+ use vtx-auth-types.{current-user};
154
175
 
155
176
  get-current-user: func() -> option<current-user>;
156
177
  }
157
178
 
158
- interface event-bus {
179
+ interface vtx-event-bus {
159
180
  publish-event: func(
160
181
  topic: string,
161
182
  payload: string,
162
183
  ) -> result<_, string>;
163
184
  }
164
185
 
165
- interface http-client {
166
- use types.{http-client-request, http-client-response};
186
+ interface vtx-http-client {
187
+ use vtx-types.{http-client-request, http-client-response};
167
188
 
168
189
  request: func(
169
190
  req: http-client-request,
170
191
  ) -> result<http-client-response, string>;
171
192
  }
172
193
 
173
- world plugin {
174
- use types.{capabilities, http-request, http-response, manifest};
175
- use auth-types.{user-context};
176
- use events.{vtx-event};
177
-
178
- import stream-io;
179
- import sql;
180
- import ffmpeg;
181
- import context;
182
- import event-bus;
183
- import http-client;
194
+ world vtx-plugin {
195
+ use vtx-types.{capabilities, http-request, http-response, manifest};
196
+ use vtx-auth-types.{user-context};
197
+ use vtx-events.{vtx-event};
198
+
199
+ import vtx-vfs;
200
+ import vtx-sql;
201
+ import vtx-ffmpeg;
202
+ import vtx-context;
203
+ import vtx-event-bus;
204
+ import vtx-http-client;
184
205
 
185
206
  export handle: func(
186
207
  req: http-request,