@opencode/schema 0.0.0-dev-1308 → 0.0.0-dev-1310
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/blob-store.d.ts +6 -7
- package/dist/blob-store.js +9 -8
- package/dist/generate.d.ts +6 -4
- package/dist/generate.js +1 -1
- package/package.json +1 -1
package/dist/blob-store.d.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
export * as BlobStore from "./blob-store.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export declare const ID: Schema.brand<Schema.String, "Blob.ID">;
|
|
3
|
+
export declare const ID: Schema.brand<Schema.String, "Blob.ID"> & {
|
|
4
|
+
create: () => string & import("effect/Brand").Brand<"Blob.ID">;
|
|
5
|
+
};
|
|
8
6
|
export type ID = typeof ID.Type;
|
|
9
7
|
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
10
8
|
}
|
|
11
9
|
export declare const Info: Schema.Struct<{
|
|
12
|
-
readonly id: Schema.brand<Schema.String, "Blob.ID"
|
|
10
|
+
readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
|
|
11
|
+
create: () => string & import("effect/Brand").Brand<"Blob.ID">;
|
|
12
|
+
};
|
|
13
13
|
readonly mime: Schema.String;
|
|
14
14
|
readonly bytes: Schema.Finite;
|
|
15
|
-
readonly expiresAt: Schema.Finite;
|
|
16
15
|
}>;
|
package/dist/blob-store.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
export * as BlobStore from "./blob-store.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import { descending } from "./identifier.js";
|
|
4
|
+
import { statics } from "./schema.js";
|
|
5
|
+
// Strict, because the server names files after it.
|
|
6
|
+
export const ID = Schema.String.check(Schema.isPattern(/^blob_[0-9a-f]{12}[0-9A-Za-z]{14}$/u)).pipe(Schema.brand("Blob.ID"), Schema.annotate({
|
|
7
|
+
identifier: "Blob.ID",
|
|
8
|
+
description: "A stored blob, such as a generated video, which outlives the job that made it",
|
|
9
|
+
}), statics((schema) => ({
|
|
10
|
+
create: () => schema.make("blob_" + descending()),
|
|
11
|
+
})));
|
|
8
12
|
export const Info = Schema.Struct({
|
|
9
13
|
id: ID,
|
|
10
14
|
mime: Schema.String,
|
|
11
15
|
bytes: Schema.Finite,
|
|
12
|
-
expiresAt: Schema.Finite.annotate({
|
|
13
|
-
description: "Epoch milliseconds after which the blob may be deleted. Read it with GET /api/experimental/blob/:id",
|
|
14
|
-
}),
|
|
15
16
|
}).annotate({ identifier: "Blob.Info" });
|
package/dist/generate.d.ts
CHANGED
|
@@ -185,10 +185,11 @@ export declare const VideoCompleted: Schema.Struct<{
|
|
|
185
185
|
};
|
|
186
186
|
readonly status: Schema.Literal<"completed">;
|
|
187
187
|
readonly blobs: Schema.$Array<Schema.Struct<{
|
|
188
|
-
readonly id: Schema.brand<Schema.String, "Blob.ID"
|
|
188
|
+
readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
|
|
189
|
+
create: () => string & import("effect/Brand").Brand<"Blob.ID">;
|
|
190
|
+
};
|
|
189
191
|
readonly mime: Schema.String;
|
|
190
192
|
readonly bytes: Schema.Finite;
|
|
191
|
-
readonly expiresAt: Schema.Finite;
|
|
192
193
|
}>>;
|
|
193
194
|
}>;
|
|
194
195
|
export interface VideoError extends Schema.Schema.Type<typeof VideoError> {
|
|
@@ -213,10 +214,11 @@ export declare const VideoJob: Schema.Union<readonly [Schema.Struct<{
|
|
|
213
214
|
};
|
|
214
215
|
readonly status: Schema.Literal<"completed">;
|
|
215
216
|
readonly blobs: Schema.$Array<Schema.Struct<{
|
|
216
|
-
readonly id: Schema.brand<Schema.String, "Blob.ID"
|
|
217
|
+
readonly id: Schema.brand<Schema.String, "Blob.ID"> & {
|
|
218
|
+
create: () => string & import("effect/Brand").Brand<"Blob.ID">;
|
|
219
|
+
};
|
|
217
220
|
readonly mime: Schema.String;
|
|
218
221
|
readonly bytes: Schema.Finite;
|
|
219
|
-
readonly expiresAt: Schema.Finite;
|
|
220
222
|
}>>;
|
|
221
223
|
}>, Schema.Struct<{
|
|
222
224
|
readonly id: Schema.brand<Schema.String, "Generate.VideoID"> & {
|
package/dist/generate.js
CHANGED
|
@@ -85,7 +85,7 @@ export const VideoRequest = Schema.Struct({
|
|
|
85
85
|
}).annotate({ identifier: "Generate.VideoRequest" });
|
|
86
86
|
export const VideoErrorReason = Schema.Literals(["failed", "cancelled", "expired", "unknown"]).annotate({
|
|
87
87
|
identifier: "Generate.VideoErrorReason",
|
|
88
|
-
description: "failed: the provider failed the job. cancelled: the provider cancelled it. expired: the provider expired it. unknown: the provider gave no result in time",
|
|
88
|
+
description: "failed: the provider failed the job. cancelled: the provider cancelled it. expired: the provider expired it. unknown: the provider gave no result in time, or the server stopped while submitting the job",
|
|
89
89
|
});
|
|
90
90
|
export const VideoRunning = Schema.Struct({
|
|
91
91
|
id: VideoID,
|