@vtxdeo/protocol 3.5.2 → 4.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 +56 -30
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtxdeo/protocol",
3
- "version": "3.5.2",
3
+ "version": "4.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,21 +134,26 @@ 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};
139
+
140
+ record ffmpeg-option {
141
+ key: string,
142
+ value: option<string>,
143
+ }
118
144
 
119
- record transcode-params {
145
+ record transcode-profile {
120
146
  profile: string,
121
147
  input-id: string,
122
- args: list<string>,
148
+ options: list<ffmpeg-option>,
123
149
  }
124
150
 
125
151
  execute: func(
126
- params: transcode-params,
152
+ params: transcode-profile,
127
153
  ) -> result<buffer, string>;
128
154
  }
129
155
 
130
- interface events {
156
+ interface vtx-events {
131
157
  record event-context {
132
158
  user-id: option<string>,
133
159
  username: option<string>,
@@ -144,21 +170,21 @@ interface events {
144
170
  }
145
171
  }
146
172
 
147
- interface context {
148
- use auth-types.{current-user};
173
+ interface vtx-context {
174
+ use vtx-auth-types.{current-user};
149
175
 
150
176
  get-current-user: func() -> option<current-user>;
151
177
  }
152
178
 
153
- interface event-bus {
179
+ interface vtx-event-bus {
154
180
  publish-event: func(
155
181
  topic: string,
156
182
  payload: string,
157
183
  ) -> result<_, string>;
158
184
  }
159
185
 
160
- interface http-client {
161
- use types.{http-client-request, http-client-response};
186
+ interface vtx-http-client {
187
+ use vtx-types.{http-client-request, http-client-response};
162
188
 
163
189
  request: func(
164
190
  req: http-client-request,
@@ -166,16 +192,16 @@ interface http-client {
166
192
  }
167
193
 
168
194
  world plugin {
169
- use types.{capabilities, http-request, http-response, manifest};
170
- use auth-types.{user-context};
171
- use events.{vtx-event};
172
-
173
- import stream-io;
174
- import sql;
175
- import ffmpeg;
176
- import context;
177
- import event-bus;
178
- import http-client;
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;
179
205
 
180
206
  export handle: func(
181
207
  req: http-request,