@oh-my-pi/pi-wire 18.2.9 → 18.2.10
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/dist/types/stream.d.ts +15 -0
- package/package.json +2 -3
- package/src/stream.ts +17 -0
package/dist/types/stream.d.ts
CHANGED
|
@@ -179,6 +179,18 @@ export declare const STREAM_CLOSE_FORBIDDEN = 4403;
|
|
|
179
179
|
/** Provider id under which `/login` stores the stencil.so credential; `STENCIL_API_KEY` overrides it. */
|
|
180
180
|
export declare const STREAM_AUTH_PROVIDER = "stencil";
|
|
181
181
|
export declare const STREAM_AUTH_ENV = "STENCIL_API_KEY";
|
|
182
|
+
/** Longest accepted clip description (runes). Titles share `STREAM_TITLE_MAX`. */
|
|
183
|
+
export declare const CLIP_DESCRIPTION_MAX = 5000;
|
|
184
|
+
/**
|
|
185
|
+
* `POST /api/clips` answer. The body is an `.ompcast` recording (optionally
|
|
186
|
+
* `Content-Encoding: gzip`) whose header may carry `title` and `description`;
|
|
187
|
+
* the bearer identifies the uploading Stencil account.
|
|
188
|
+
*/
|
|
189
|
+
export interface ClipUploadResponse {
|
|
190
|
+
id: string;
|
|
191
|
+
/** Public clip page, `<server>/c/<id>`. */
|
|
192
|
+
url: string;
|
|
193
|
+
}
|
|
182
194
|
/** HTTP/WS route layout of the stream server, relative to `DEFAULT_STREAM_URL`. */
|
|
183
195
|
export declare const STREAM_ROUTES: {
|
|
184
196
|
readonly channels: "/api/channels";
|
|
@@ -187,4 +199,7 @@ export declare const STREAM_ROUTES: {
|
|
|
187
199
|
readonly host: "/ws/host";
|
|
188
200
|
readonly watch: (name: string) => string;
|
|
189
201
|
readonly page: (name: string) => string;
|
|
202
|
+
/** Clip upload (bearer-authenticated `POST`). */
|
|
203
|
+
readonly clips: "/api/clips";
|
|
204
|
+
readonly clipPage: (id: string) => string;
|
|
190
205
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-wire",
|
|
4
|
-
"version": "18.2.
|
|
4
|
+
"version": "18.2.10",
|
|
5
5
|
"description": "Shared wire protocol types for Oh My Pi packages",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Stencil Labs, Inc.",
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
28
28
|
"lint": "oxlint .",
|
|
29
29
|
"fix": "oxlint --fix --fix-suggestions . && bun run fmt",
|
|
30
|
-
"fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
|
|
31
|
-
"test": "bun test --parallel"
|
|
30
|
+
"fmt": "oxfmt --no-error-on-unmatched-pattern 'src/**/*.{ts,tsx}' '{test,bench,examples,scripts}/**/*.ts' '*.ts'"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"@types/bun": "^1.3.14"
|
package/src/stream.ts
CHANGED
|
@@ -141,6 +141,20 @@ export const STREAM_CLOSE_FORBIDDEN = 4403;
|
|
|
141
141
|
export const STREAM_AUTH_PROVIDER = "stencil";
|
|
142
142
|
export const STREAM_AUTH_ENV = "STENCIL_API_KEY";
|
|
143
143
|
|
|
144
|
+
/** Longest accepted clip description (runes). Titles share `STREAM_TITLE_MAX`. */
|
|
145
|
+
export const CLIP_DESCRIPTION_MAX = 5000;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* `POST /api/clips` answer. The body is an `.ompcast` recording (optionally
|
|
149
|
+
* `Content-Encoding: gzip`) whose header may carry `title` and `description`;
|
|
150
|
+
* the bearer identifies the uploading Stencil account.
|
|
151
|
+
*/
|
|
152
|
+
export interface ClipUploadResponse {
|
|
153
|
+
id: string;
|
|
154
|
+
/** Public clip page, `<server>/c/<id>`. */
|
|
155
|
+
url: string;
|
|
156
|
+
}
|
|
157
|
+
|
|
144
158
|
/** HTTP/WS route layout of the stream server, relative to `DEFAULT_STREAM_URL`. */
|
|
145
159
|
export const STREAM_ROUTES = {
|
|
146
160
|
channels: "/api/channels",
|
|
@@ -149,4 +163,7 @@ export const STREAM_ROUTES = {
|
|
|
149
163
|
host: "/ws/host",
|
|
150
164
|
watch: (name: string) => `/ws/watch/${name}`,
|
|
151
165
|
page: (name: string) => `/${name}`,
|
|
166
|
+
/** Clip upload (bearer-authenticated `POST`). */
|
|
167
|
+
clips: "/api/clips",
|
|
168
|
+
clipPage: (id: string) => `/c/${id}`,
|
|
152
169
|
} as const;
|