@devultur/convex 1.3.1 → 1.4.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/README.md +462 -9
- package/dist/bin/init.js +44 -23
- package/dist/chunk-EX3W77VY.js +245 -0
- package/dist/chunk-HOFTKJWT.js +58 -0
- package/dist/chunk-KAIVI7RB.js +21 -0
- package/dist/chunk-QBHIZBOQ.js +139 -0
- package/dist/{chunk-GKLFRSGI.js → chunk-YIPZZDGD.js} +8 -1
- package/dist/component/_generated/api.d.ts +6 -0
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +27 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/library.d.ts +93 -0
- package/dist/component/library.d.ts.map +1 -0
- package/dist/component/library.js +74 -0
- package/dist/component/library.js.map +1 -0
- package/dist/component/mediaMeta.d.ts +46 -0
- package/dist/component/mediaMeta.d.ts.map +1 -0
- package/dist/component/mediaMeta.js +82 -0
- package/dist/component/mediaMeta.js.map +1 -0
- package/dist/component/metadata.d.ts +59 -0
- package/dist/component/metadata.d.ts.map +1 -0
- package/dist/component/metadata.js +32 -0
- package/dist/component/metadata.js.map +1 -0
- package/dist/component/public.d.ts +17 -1
- package/dist/component/public.d.ts.map +1 -1
- package/dist/component/public.js +20 -11
- package/dist/component/public.js.map +1 -1
- package/dist/component/schema.d.ts +17 -2
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +13 -1
- package/dist/component/schema.js.map +1 -1
- package/dist/component/uploads.d.ts +13 -0
- package/dist/component/uploads.d.ts.map +1 -1
- package/dist/component/uploads.js +24 -5
- package/dist/component/uploads.js.map +1 -1
- package/dist/error-labels-BfqcFh2R.d.ts +19 -0
- package/dist/index.d.ts +204 -93
- package/dist/index.js +200 -128
- package/dist/locales/es.d.ts +11 -0
- package/dist/locales/es.js +162 -0
- package/dist/media-picker-labels-CiVcNUZo.d.ts +114 -0
- package/dist/{pdf-render-CiCK6V1X.d.ts → pdf-render-BwJGagvz.d.ts} +1 -1
- package/dist/pdfjs.d.ts +13 -2
- package/dist/pdfjs.js +9 -0
- package/dist/react.d.ts +462 -64
- package/dist/react.js +1625 -493
- package/dist/types-LrusGVDf.d.ts +62 -0
- package/dist/validators.d.ts +13 -1
- package/dist/validators.js +1 -1
- package/package.json +8 -4
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
// src/error-codes.ts
|
|
2
|
+
var DEVULTUR_ERROR_CODES = [
|
|
3
|
+
// Uploads
|
|
4
|
+
"file_too_large",
|
|
5
|
+
"content_type_not_allowed",
|
|
6
|
+
"content_type_mismatch",
|
|
7
|
+
"content_unverified",
|
|
8
|
+
"unsupported_content_type",
|
|
9
|
+
"media_type_mismatch",
|
|
10
|
+
"already_exists",
|
|
11
|
+
"write_conflict",
|
|
12
|
+
"upload_not_found",
|
|
13
|
+
"invalid_upload_key",
|
|
14
|
+
"invalid_path",
|
|
15
|
+
"path_required",
|
|
16
|
+
"invalid_expires_in",
|
|
17
|
+
"invalid_file_expires_in",
|
|
18
|
+
"invalid_cache_control",
|
|
19
|
+
"invalid_limits",
|
|
20
|
+
"invalid_prefix",
|
|
21
|
+
"invalid_visibility",
|
|
22
|
+
"invalid_cursor",
|
|
23
|
+
"invalid_sha256",
|
|
24
|
+
"sha256_mismatch",
|
|
25
|
+
"max_files_reached",
|
|
26
|
+
"invalid_multipart",
|
|
27
|
+
"invalid_size",
|
|
28
|
+
"invalid_part",
|
|
29
|
+
"invalid_parts",
|
|
30
|
+
"part_size_mismatch",
|
|
31
|
+
"part_sha256_required",
|
|
32
|
+
// Media metadata (`updateMediaMeta`, `confirmUpload`'s hints)
|
|
33
|
+
"invalid_media_metadata",
|
|
34
|
+
// Delivery and download links
|
|
35
|
+
"expired",
|
|
36
|
+
"invalid_key",
|
|
37
|
+
"invalid_max_uses",
|
|
38
|
+
"link_exists",
|
|
39
|
+
"link_not_found",
|
|
40
|
+
"link_expired",
|
|
41
|
+
"link_used",
|
|
42
|
+
"not_configured",
|
|
43
|
+
// Retention and holds
|
|
44
|
+
"retention_active",
|
|
45
|
+
"lock_conflict",
|
|
46
|
+
"compliance_extend_only",
|
|
47
|
+
"lock_privilege_required",
|
|
48
|
+
"lock_record_unreadable",
|
|
49
|
+
"lock_below_minimum",
|
|
50
|
+
"invalid_lock",
|
|
51
|
+
"invalid_hold",
|
|
52
|
+
"reserved_key",
|
|
53
|
+
// Encryption at rest
|
|
54
|
+
"keys_bucket_missing",
|
|
55
|
+
"encryption_key_missing",
|
|
56
|
+
// Tokens and sessions
|
|
57
|
+
"unauthorized",
|
|
58
|
+
"session_mismatch",
|
|
59
|
+
"token_rejected",
|
|
60
|
+
"reserved_user_id",
|
|
61
|
+
"invalid_scopes",
|
|
62
|
+
// The progress functions, given another user's `userId` than the guard's
|
|
63
|
+
"user_mismatch",
|
|
64
|
+
// Video and captions
|
|
65
|
+
"transcode_not_configured",
|
|
66
|
+
"transcode_runner_unavailable",
|
|
67
|
+
"transcode_launch_failed",
|
|
68
|
+
"original_not_retained",
|
|
69
|
+
"locale_not_allowed",
|
|
70
|
+
"captions_provider_rate_limited",
|
|
71
|
+
"captions_provider_error",
|
|
72
|
+
"captions_failed",
|
|
73
|
+
// Worker configuration
|
|
74
|
+
"webhook_secret_missing",
|
|
75
|
+
"worker_auth_secret_missing",
|
|
76
|
+
// A Worker refusal without a code
|
|
77
|
+
"worker_error",
|
|
78
|
+
// `MediaFetchError` (previews, downloads, object URLs)
|
|
79
|
+
"http_error",
|
|
80
|
+
"too_large",
|
|
81
|
+
"unsupported_type",
|
|
82
|
+
"type_mismatch",
|
|
83
|
+
"token_unavailable",
|
|
84
|
+
// `DevulturCapabilityError` (an action the provider wasn't given)
|
|
85
|
+
"capability_unavailable"
|
|
86
|
+
];
|
|
87
|
+
var KNOWN_CODES = new Set(DEVULTUR_ERROR_CODES);
|
|
88
|
+
function isDevulturErrorCode(code) {
|
|
89
|
+
return typeof code === "string" && KNOWN_CODES.has(code);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// src/errors.ts
|
|
93
|
+
import { ConvexError } from "convex/values";
|
|
94
|
+
function isErrorData(data) {
|
|
95
|
+
if (typeof data !== "object" || data === null) return false;
|
|
96
|
+
const fields = data;
|
|
97
|
+
return typeof fields.code === "string" && typeof fields.status === "number" && typeof fields.message === "string";
|
|
98
|
+
}
|
|
99
|
+
function isDevulturError(error) {
|
|
100
|
+
return error instanceof ConvexError && isErrorData(error.data);
|
|
101
|
+
}
|
|
102
|
+
function devulturErrorOf(error) {
|
|
103
|
+
return isDevulturError(error) ? error.data : null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// src/error-labels.ts
|
|
107
|
+
function formatBytes(bytes, locale) {
|
|
108
|
+
const isMegabytes = bytes >= 1e6;
|
|
109
|
+
const amount = isMegabytes ? bytes / 1e6 : bytes / 1e3;
|
|
110
|
+
const unit = isMegabytes ? "megabyte" : "kilobyte";
|
|
111
|
+
return new Intl.NumberFormat(locale, { style: "unit", unit, maximumFractionDigits: 1 }).format(amount);
|
|
112
|
+
}
|
|
113
|
+
function formatDate(value, locale) {
|
|
114
|
+
if (typeof value !== "string" && typeof value !== "number") return null;
|
|
115
|
+
const date = new Date(value);
|
|
116
|
+
if (Number.isNaN(date.getTime())) return null;
|
|
117
|
+
return new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date);
|
|
118
|
+
}
|
|
119
|
+
function sizeLimit(details, locale) {
|
|
120
|
+
return typeof details.limit === "number" ? formatBytes(details.limit, locale) : null;
|
|
121
|
+
}
|
|
122
|
+
var devulturErrorLabels = {
|
|
123
|
+
file_too_large: (details) => {
|
|
124
|
+
const limit = sizeLimit(details, "en");
|
|
125
|
+
return limit ? `The file exceeds the maximum size (${limit}).` : "The file exceeds the maximum size.";
|
|
126
|
+
},
|
|
127
|
+
content_type_not_allowed: "This file type isn't allowed.",
|
|
128
|
+
content_type_mismatch: "The file's content doesn't match its type.",
|
|
129
|
+
content_unverified: "The upload couldn't be verified. Try again.",
|
|
130
|
+
unsupported_content_type: "This file type isn't supported.",
|
|
131
|
+
media_type_mismatch: "The file type doesn't match the kind of media expected.",
|
|
132
|
+
already_exists: "A file with this name already exists.",
|
|
133
|
+
write_conflict: "The file changed while it was being saved. Try again.",
|
|
134
|
+
upload_not_found: "The upload wasn't found or has expired. Start it again.",
|
|
135
|
+
invalid_upload_key: "This isn't a valid upload.",
|
|
136
|
+
invalid_path: "The file path isn't valid.",
|
|
137
|
+
path_required: "This upload needs a file path.",
|
|
138
|
+
invalid_expires_in: "The expiration time isn't valid.",
|
|
139
|
+
invalid_file_expires_in: "The file's expiration time isn't valid.",
|
|
140
|
+
invalid_cache_control: "The cache setting isn't valid.",
|
|
141
|
+
invalid_limits: "The upload limits aren't valid.",
|
|
142
|
+
invalid_prefix: "The folder isn't valid.",
|
|
143
|
+
invalid_visibility: "The visibility must be public or private.",
|
|
144
|
+
invalid_cursor: "The page of results isn't valid. Reload the list.",
|
|
145
|
+
invalid_sha256: "The file's checksum isn't valid.",
|
|
146
|
+
sha256_mismatch: "The file was corrupted during the upload. Try again.",
|
|
147
|
+
max_files_reached: "You've reached the maximum number of files for this upload.",
|
|
148
|
+
invalid_multipart: "The upload request isn't valid.",
|
|
149
|
+
invalid_size: "The file size isn't valid.",
|
|
150
|
+
invalid_part: "Part of the upload isn't valid. Try again.",
|
|
151
|
+
invalid_parts: "The upload is incomplete. Try again.",
|
|
152
|
+
invalid_media_metadata: (details) => {
|
|
153
|
+
if (details.field === "title") return "The title can't be longer than 200 characters.";
|
|
154
|
+
if (details.field === "alt") return "The alternative text can't be longer than 1,000 characters.";
|
|
155
|
+
if (details.field === "tags") return "Use at most 20 tags, of up to 50 characters each.";
|
|
156
|
+
return "The file's details aren't valid.";
|
|
157
|
+
},
|
|
158
|
+
part_size_mismatch: "Part of the upload has the wrong size. Try again.",
|
|
159
|
+
part_sha256_required: "Part of the upload is missing its checksum.",
|
|
160
|
+
expired: "This file has expired.",
|
|
161
|
+
invalid_key: "This file reference isn't valid.",
|
|
162
|
+
invalid_max_uses: "The number of uses isn't valid.",
|
|
163
|
+
link_exists: "This download link already exists.",
|
|
164
|
+
link_not_found: "This download link doesn't exist.",
|
|
165
|
+
link_expired: "This download link has expired.",
|
|
166
|
+
link_used: "This download link was already used.",
|
|
167
|
+
not_configured: "This feature isn't set up.",
|
|
168
|
+
retention_active: (details) => {
|
|
169
|
+
if (details.hold === true) return "This file is on hold and can't be changed or deleted.";
|
|
170
|
+
const until = formatDate(details.until, "en");
|
|
171
|
+
return until ? `This file is retained until ${until} and can't be changed or deleted before then.` : "This file is retained and can't be changed or deleted.";
|
|
172
|
+
},
|
|
173
|
+
lock_conflict: "The file's lock changed meanwhile. Try again.",
|
|
174
|
+
compliance_extend_only: "This file's retention can only be extended.",
|
|
175
|
+
lock_privilege_required: "You don't have permission to shorten or remove this file's retention.",
|
|
176
|
+
lock_record_unreadable: "The file's retention couldn't be read.",
|
|
177
|
+
lock_below_minimum: "This upload requires a stricter retention.",
|
|
178
|
+
invalid_lock: "The retention settings aren't valid.",
|
|
179
|
+
invalid_hold: "The hold setting isn't valid.",
|
|
180
|
+
reserved_key: "This file name is reserved.",
|
|
181
|
+
keys_bucket_missing: "Files can't be stored securely right now.",
|
|
182
|
+
encryption_key_missing: "This file can no longer be read. Upload it again.",
|
|
183
|
+
unauthorized: "You aren't authorized to do this.",
|
|
184
|
+
session_mismatch: "Your session changed. Reload the page.",
|
|
185
|
+
token_rejected: "Access was denied.",
|
|
186
|
+
reserved_user_id: "This user ID is reserved.",
|
|
187
|
+
invalid_scopes: "The requested permissions aren't valid.",
|
|
188
|
+
user_mismatch: "You can only see and change your own progress.",
|
|
189
|
+
transcode_not_configured: "Video processing isn't set up.",
|
|
190
|
+
transcode_runner_unavailable: "Video processing is busy right now. Try again later.",
|
|
191
|
+
transcode_launch_failed: "The video couldn't be processed.",
|
|
192
|
+
original_not_retained: "The original video is no longer available, so it can't be processed again. Upload it again.",
|
|
193
|
+
locale_not_allowed: "Captions aren't available in this language.",
|
|
194
|
+
captions_provider_rate_limited: "Captions are busy right now. Try again later.",
|
|
195
|
+
captions_provider_error: "The captions couldn't be generated.",
|
|
196
|
+
captions_failed: "The captions couldn't be generated.",
|
|
197
|
+
webhook_secret_missing: "Video processing isn't set up.",
|
|
198
|
+
worker_auth_secret_missing: "The media service isn't set up.",
|
|
199
|
+
worker_error: "The media service couldn't complete the request.",
|
|
200
|
+
http_error: "The file couldn't be loaded.",
|
|
201
|
+
too_large: "The file is too large to preview.",
|
|
202
|
+
unsupported_type: "This file type can't be previewed.",
|
|
203
|
+
type_mismatch: "The file's content doesn't match its type.",
|
|
204
|
+
token_unavailable: "Access to this file couldn't be granted. Try again.",
|
|
205
|
+
capability_unavailable: "This app can't do that here."
|
|
206
|
+
};
|
|
207
|
+
function asRecord(value) {
|
|
208
|
+
return typeof value === "object" && value !== null ? value : {};
|
|
209
|
+
}
|
|
210
|
+
function codedErrorOf(error) {
|
|
211
|
+
if (!(error instanceof Error)) return null;
|
|
212
|
+
const { code, status, details, limit } = error;
|
|
213
|
+
const statusField = typeof status === "number" ? { status } : {};
|
|
214
|
+
if (error.name === "MediaFetchError" && typeof code === "string") return { code, details: statusField };
|
|
215
|
+
if (error.name === "DevulturCapabilityError") return { code: "capability_unavailable", details: {} };
|
|
216
|
+
if (error.name !== "DevulturApiError") return null;
|
|
217
|
+
const limitField = typeof limit === "number" ? { limit } : {};
|
|
218
|
+
return {
|
|
219
|
+
code: typeof code === "string" ? code : "worker_error",
|
|
220
|
+
details: { ...asRecord(details), ...limitField, ...statusField }
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
function descriptorOf(error) {
|
|
224
|
+
const refusal = devulturErrorOf(error);
|
|
225
|
+
if (!refusal) return codedErrorOf(error);
|
|
226
|
+
return { code: refusal.code, details: { ...refusal.details, status: refusal.status } };
|
|
227
|
+
}
|
|
228
|
+
function describeDevulturError(error, labels) {
|
|
229
|
+
const descriptor = descriptorOf(error);
|
|
230
|
+
if (!descriptor) return null;
|
|
231
|
+
const code = isDevulturErrorCode(descriptor.code) ? descriptor.code : "worker_error";
|
|
232
|
+
const label = labels?.[code] ?? devulturErrorLabels[code];
|
|
233
|
+
return typeof label === "function" ? label(descriptor.details) : label;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export {
|
|
237
|
+
DEVULTUR_ERROR_CODES,
|
|
238
|
+
isDevulturErrorCode,
|
|
239
|
+
isDevulturError,
|
|
240
|
+
devulturErrorOf,
|
|
241
|
+
formatBytes,
|
|
242
|
+
formatDate,
|
|
243
|
+
devulturErrorLabels,
|
|
244
|
+
describeDevulturError
|
|
245
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/pdf-render.ts
|
|
2
|
+
var MOBILE_MAX_CANVAS_PIXELS = 5242880;
|
|
3
|
+
var DESKTOP_MAX_CANVAS_PIXELS = 2 ** 25;
|
|
4
|
+
function openPdf(pdfjs, bytes, workerSrc) {
|
|
5
|
+
if (workerSrc) pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;
|
|
6
|
+
const source = { data: bytes.slice(), enableScripting: false, isEvalSupported: false };
|
|
7
|
+
return pdfjs.getDocument(source);
|
|
8
|
+
}
|
|
9
|
+
async function countPages(pdfjs, file, workerSrc) {
|
|
10
|
+
const task = openPdf(pdfjs, new Uint8Array(await file.arrayBuffer()), workerSrc);
|
|
11
|
+
try {
|
|
12
|
+
const document = await task.promise;
|
|
13
|
+
return document.numPages;
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
} finally {
|
|
17
|
+
await task.destroy();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function isMobileDevice() {
|
|
21
|
+
if (typeof navigator === "undefined") return false;
|
|
22
|
+
return /Android|iPhone|iPad|iPod/.test(navigator.userAgent) || navigator.maxTouchPoints > 1;
|
|
23
|
+
}
|
|
24
|
+
function maxCanvasPixels() {
|
|
25
|
+
return isMobileDevice() ? MOBILE_MAX_CANVAS_PIXELS : DESKTOP_MAX_CANVAS_PIXELS;
|
|
26
|
+
}
|
|
27
|
+
function outputScale(cssWidth, cssHeight, maxPixels) {
|
|
28
|
+
const devicePixelRatio = typeof window !== "undefined" && window.devicePixelRatio || 1;
|
|
29
|
+
const cssPixels = cssWidth * cssHeight;
|
|
30
|
+
if (cssPixels <= 0) return devicePixelRatio;
|
|
31
|
+
if (cssPixels * devicePixelRatio ** 2 <= maxPixels) return devicePixelRatio;
|
|
32
|
+
return Math.sqrt(maxPixels / cssPixels);
|
|
33
|
+
}
|
|
34
|
+
function renderPage(page, canvas, cssWidth) {
|
|
35
|
+
const naturalViewport = page.getViewport({ scale: 1 });
|
|
36
|
+
const cssScale = cssWidth > 0 ? cssWidth / naturalViewport.width : 1;
|
|
37
|
+
const cssViewport = page.getViewport({ scale: cssScale });
|
|
38
|
+
const scale = outputScale(cssViewport.width, cssViewport.height, maxCanvasPixels());
|
|
39
|
+
const viewport = page.getViewport({ scale: cssScale * scale });
|
|
40
|
+
canvas.width = Math.floor(viewport.width);
|
|
41
|
+
canvas.height = Math.floor(viewport.height);
|
|
42
|
+
canvas.style.width = `${Math.floor(cssViewport.width)}px`;
|
|
43
|
+
canvas.style.height = `${Math.floor(cssViewport.height)}px`;
|
|
44
|
+
return page.render({ canvas, viewport });
|
|
45
|
+
}
|
|
46
|
+
async function pageText(page) {
|
|
47
|
+
const { items } = await page.getTextContent();
|
|
48
|
+
return items.map((item) => "str" in item && typeof item.str === "string" ? item.str : "").join(" ").replace(/\s+/g, " ").trim();
|
|
49
|
+
}
|
|
50
|
+
var isRenderCancelled = (error) => error instanceof Error && error.name === "RenderingCancelledException";
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
openPdf,
|
|
54
|
+
countPages,
|
|
55
|
+
renderPage,
|
|
56
|
+
pageText,
|
|
57
|
+
isRenderCancelled
|
|
58
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/media-record.ts
|
|
2
|
+
var OPTIONAL_FIELDS = ["width", "height", "title", "alt", "tags", "duration", "pageCount"];
|
|
3
|
+
function mediaFromRecord(record) {
|
|
4
|
+
if (!record.visibility) return null;
|
|
5
|
+
const optionalFields = Object.fromEntries(
|
|
6
|
+
OPTIONAL_FIELDS.filter((field) => record[field] !== void 0).map((field) => [field, record[field]])
|
|
7
|
+
);
|
|
8
|
+
return {
|
|
9
|
+
id: record.key,
|
|
10
|
+
kind: record.type,
|
|
11
|
+
visibility: record.visibility,
|
|
12
|
+
filename: record.filename,
|
|
13
|
+
...record.objectKey ? { key: record.objectKey } : {},
|
|
14
|
+
sizeBytes: record.sizeBytes,
|
|
15
|
+
...optionalFields
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
mediaFromRecord
|
|
21
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// src/preview-type.ts
|
|
2
|
+
var PREVIEW_KIND_BY_TYPE = /* @__PURE__ */ new Map([
|
|
3
|
+
["image/png", "image"],
|
|
4
|
+
["image/jpeg", "image"],
|
|
5
|
+
["image/webp", "image"],
|
|
6
|
+
["image/gif", "image"],
|
|
7
|
+
["image/avif", "image"],
|
|
8
|
+
["application/pdf", "pdf"],
|
|
9
|
+
["audio/mpeg", "audio"],
|
|
10
|
+
["audio/mp4", "audio"],
|
|
11
|
+
["audio/aac", "audio"],
|
|
12
|
+
["audio/ogg", "audio"],
|
|
13
|
+
["audio/wav", "audio"],
|
|
14
|
+
["audio/webm", "audio"],
|
|
15
|
+
["audio/flac", "audio"],
|
|
16
|
+
["text/plain", "text"],
|
|
17
|
+
["text/csv", "text"],
|
|
18
|
+
["application/json", "text"]
|
|
19
|
+
]);
|
|
20
|
+
var TYPE_BY_EXTENSION = /* @__PURE__ */ new Map([
|
|
21
|
+
["png", "image/png"],
|
|
22
|
+
["jpg", "image/jpeg"],
|
|
23
|
+
["jpeg", "image/jpeg"],
|
|
24
|
+
["webp", "image/webp"],
|
|
25
|
+
["gif", "image/gif"],
|
|
26
|
+
["avif", "image/avif"],
|
|
27
|
+
["pdf", "application/pdf"],
|
|
28
|
+
["mp3", "audio/mpeg"],
|
|
29
|
+
["m4a", "audio/mp4"],
|
|
30
|
+
["aac", "audio/aac"],
|
|
31
|
+
["ogg", "audio/ogg"],
|
|
32
|
+
["oga", "audio/ogg"],
|
|
33
|
+
["opus", "audio/ogg"],
|
|
34
|
+
["wav", "audio/wav"],
|
|
35
|
+
["weba", "audio/webm"],
|
|
36
|
+
["flac", "audio/flac"],
|
|
37
|
+
["txt", "text/plain"],
|
|
38
|
+
["csv", "text/csv"],
|
|
39
|
+
["json", "application/json"]
|
|
40
|
+
]);
|
|
41
|
+
var OPAQUE_CONTENT_TYPE = "application/octet-stream";
|
|
42
|
+
function normalizeContentType(value) {
|
|
43
|
+
const essence = value?.split(";")[0]?.trim().toLowerCase();
|
|
44
|
+
return essence || null;
|
|
45
|
+
}
|
|
46
|
+
function previewKindOf(contentType) {
|
|
47
|
+
const normalized = normalizeContentType(contentType);
|
|
48
|
+
if (!normalized) return null;
|
|
49
|
+
return PREVIEW_KIND_BY_TYPE.get(normalized) ?? null;
|
|
50
|
+
}
|
|
51
|
+
function expectedContentType(media, declaredType) {
|
|
52
|
+
if (declaredType) return normalizeContentType(declaredType);
|
|
53
|
+
const extension = media.filename?.split(".").pop()?.toLowerCase();
|
|
54
|
+
if (!extension || extension === media.filename?.toLowerCase()) return null;
|
|
55
|
+
return TYPE_BY_EXTENSION.get(extension) ?? null;
|
|
56
|
+
}
|
|
57
|
+
function trustedContentType(expectedType, responseType) {
|
|
58
|
+
const receivedKind = previewKindOf(responseType);
|
|
59
|
+
if (!expectedType) {
|
|
60
|
+
const contentType = receivedKind ? normalizeContentType(responseType) : null;
|
|
61
|
+
return { ok: true, contentType: contentType ?? OPAQUE_CONTENT_TYPE };
|
|
62
|
+
}
|
|
63
|
+
const expectedKind = previewKindOf(expectedType);
|
|
64
|
+
if (!expectedKind) return { ok: false, reason: "unsupported_type" };
|
|
65
|
+
if (receivedKind !== expectedKind) return { ok: false, reason: "type_mismatch" };
|
|
66
|
+
return { ok: true, contentType: normalizeContentType(expectedType) ?? OPAQUE_CONTENT_TYPE };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/attachment-labels.ts
|
|
70
|
+
var KIND_TEXT = {
|
|
71
|
+
image: "Image",
|
|
72
|
+
video: "Video",
|
|
73
|
+
pdf: "PDF",
|
|
74
|
+
audio: "Audio",
|
|
75
|
+
text: "Text",
|
|
76
|
+
file: "File"
|
|
77
|
+
};
|
|
78
|
+
var SIZE_UNITS = [
|
|
79
|
+
{ unit: "gigabyte", bytes: 1e9 },
|
|
80
|
+
{ unit: "megabyte", bytes: 1e6 },
|
|
81
|
+
{ unit: "kilobyte", bytes: 1e3 }
|
|
82
|
+
];
|
|
83
|
+
function formatFileSize(bytes, locale) {
|
|
84
|
+
const scale = SIZE_UNITS.find((candidate) => bytes >= candidate.bytes);
|
|
85
|
+
if (!scale) return new Intl.NumberFormat(locale, { style: "unit", unit: "byte", unitDisplay: "long" }).format(bytes);
|
|
86
|
+
const amount = bytes / scale.bytes;
|
|
87
|
+
return new Intl.NumberFormat(locale, { style: "unit", unit: scale.unit, maximumFractionDigits: 1 }).format(amount);
|
|
88
|
+
}
|
|
89
|
+
function formatDuration(seconds) {
|
|
90
|
+
const totalSeconds = Math.max(0, Math.round(seconds));
|
|
91
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
92
|
+
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
93
|
+
const remainder = String(totalSeconds % 60).padStart(2, "0");
|
|
94
|
+
if (hours === 0) return `${minutes}:${remainder}`;
|
|
95
|
+
return `${hours}:${String(minutes).padStart(2, "0")}:${remainder}`;
|
|
96
|
+
}
|
|
97
|
+
var defaultAttachmentLabels = {
|
|
98
|
+
locale: "en",
|
|
99
|
+
size: formatFileSize,
|
|
100
|
+
pages: (pageCount) => pageCount === 1 ? "1 page" : `${pageCount.toLocaleString("en")} pages`,
|
|
101
|
+
duration: formatDuration,
|
|
102
|
+
kind: (kind) => KIND_TEXT[kind],
|
|
103
|
+
download: "Download",
|
|
104
|
+
open: "Open preview",
|
|
105
|
+
untitled: "Untitled file"
|
|
106
|
+
};
|
|
107
|
+
function mergeAttachmentLabels(labels) {
|
|
108
|
+
const definedEntries = Object.entries(labels ?? {}).filter(([, value]) => value !== void 0);
|
|
109
|
+
return { ...defaultAttachmentLabels, ...Object.fromEntries(definedEntries) };
|
|
110
|
+
}
|
|
111
|
+
function attachmentName(media, untitled) {
|
|
112
|
+
return media.title?.trim() || media.filename || untitled;
|
|
113
|
+
}
|
|
114
|
+
function attachmentKindOf(media, contentType) {
|
|
115
|
+
if (media.kind !== "file") return media.kind;
|
|
116
|
+
const previewKind = previewKindOf(expectedContentType(media, contentType));
|
|
117
|
+
return previewKind ?? "file";
|
|
118
|
+
}
|
|
119
|
+
function attachmentDetails(media, kind, labels, locale) {
|
|
120
|
+
const details = [labels.kind(kind)];
|
|
121
|
+
if (media.sizeBytes !== void 0) details.push(labels.size(media.sizeBytes, locale));
|
|
122
|
+
if (kind === "pdf" && media.pageCount !== void 0) details.push(labels.pages(media.pageCount));
|
|
123
|
+
const hasDuration = kind === "audio" || kind === "video";
|
|
124
|
+
if (hasDuration && media.duration !== void 0) details.push(labels.duration(media.duration));
|
|
125
|
+
return details;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
previewKindOf,
|
|
130
|
+
expectedContentType,
|
|
131
|
+
trustedContentType,
|
|
132
|
+
formatFileSize,
|
|
133
|
+
formatDuration,
|
|
134
|
+
defaultAttachmentLabels,
|
|
135
|
+
mergeAttachmentLabels,
|
|
136
|
+
attachmentName,
|
|
137
|
+
attachmentKindOf,
|
|
138
|
+
attachmentDetails
|
|
139
|
+
};
|
|
@@ -7,7 +7,14 @@ var mediaFields = {
|
|
|
7
7
|
// The uploaded object's key, as `upload()` returns it. Optional: references stored before it stay valid.
|
|
8
8
|
key: v.optional(v.string()),
|
|
9
9
|
width: v.optional(v.number()),
|
|
10
|
-
height: v.optional(v.number())
|
|
10
|
+
height: v.optional(v.number()),
|
|
11
|
+
// The record's metadata, as `mediaFromRecord` copies it. Optional: references stored before 1.4.0 stay valid.
|
|
12
|
+
title: v.optional(v.string()),
|
|
13
|
+
alt: v.optional(v.string()),
|
|
14
|
+
tags: v.optional(v.array(v.string())),
|
|
15
|
+
sizeBytes: v.optional(v.number()),
|
|
16
|
+
duration: v.optional(v.number()),
|
|
17
|
+
pageCount: v.optional(v.number())
|
|
11
18
|
};
|
|
12
19
|
var dv = {
|
|
13
20
|
media(kind) {
|
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
import type * as http from "../http.js";
|
|
10
|
+
import type * as library from "../library.js";
|
|
10
11
|
import type * as lock from "../lock.js";
|
|
11
12
|
import type * as lockValidators from "../lockValidators.js";
|
|
12
13
|
import type * as mediaClient from "../mediaClient.js";
|
|
14
|
+
import type * as mediaMeta from "../mediaMeta.js";
|
|
15
|
+
import type * as metadata from "../metadata.js";
|
|
13
16
|
import type * as public_ from "../public.js";
|
|
14
17
|
import type * as uploadKeys from "../uploadKeys.js";
|
|
15
18
|
import type * as uploads from "../uploads.js";
|
|
@@ -17,9 +20,12 @@ import type * as workerErrors from "../workerErrors.js";
|
|
|
17
20
|
import type { ApiFromModules, FilterApi, FunctionReference } from "convex/server";
|
|
18
21
|
declare const fullApi: ApiFromModules<{
|
|
19
22
|
http: typeof http;
|
|
23
|
+
library: typeof library;
|
|
20
24
|
lock: typeof lock;
|
|
21
25
|
lockValidators: typeof lockValidators;
|
|
22
26
|
mediaClient: typeof mediaClient;
|
|
27
|
+
mediaMeta: typeof mediaMeta;
|
|
28
|
+
metadata: typeof metadata;
|
|
23
29
|
public: typeof public_;
|
|
24
30
|
uploadKeys: typeof uploadKeys;
|
|
25
31
|
uploads: typeof uploads;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,IAAI,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,KAAK,IAAI,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,KAAK,cAAc,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,KAAK,WAAW,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,KAAK,OAAO,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,KAAK,UAAU,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,KAAK,OAAO,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAExD,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,iBAAiB,EAClB,MAAM,eAAe,CAAC;AAGvB,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC;IAC5B,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,IAAI,EAAE,OAAO,IAAI,CAAC;IAClB,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,MAAM,EAAE,OAAO,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,YAAY,CAAC;CACnC,CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,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CAAiB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,EAAE,SAAS,CACzB,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,QAAQ,CAAC,CACjB,CAAC;AAElB;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,OAAO,OAAO,EACd,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,CACnB,CAAC;AAElB,eAAO,MAAM,UAAU,EAAqC,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/component/_generated/api.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAmBH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,OAAO,GAYR,MAAa,CAAC;AAEnB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,GAAG,GAGZ,MAAa,CAAC;AAElB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAGjB,MAAa,CAAC;AAElB,MAAM,CAAC,MAAM,UAAU,GAAG,iBAAiB,EAAmB,CAAC"}
|
|
@@ -19,6 +19,23 @@ import type { FunctionReference } from "convex/server";
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
export type ComponentApi<Name extends string | undefined = string | undefined> = {
|
|
22
|
+
library: {
|
|
23
|
+
backfillSearchText: FunctionReference<"mutation", "internal", {
|
|
24
|
+
batchSize?: number;
|
|
25
|
+
}, any, Name>;
|
|
26
|
+
searchMedia: FunctionReference<"query", "internal", {
|
|
27
|
+
paginationOpts: {
|
|
28
|
+
cursor: string | null;
|
|
29
|
+
endCursor?: string | null;
|
|
30
|
+
id?: number;
|
|
31
|
+
maximumBytesRead?: number;
|
|
32
|
+
maximumRowsRead?: number;
|
|
33
|
+
numItems: number;
|
|
34
|
+
};
|
|
35
|
+
search: string;
|
|
36
|
+
type?: "video" | "image" | "file";
|
|
37
|
+
}, any, Name>;
|
|
38
|
+
};
|
|
22
39
|
lock: {
|
|
23
40
|
getLock: FunctionReference<"action", "internal", {
|
|
24
41
|
key: string;
|
|
@@ -39,6 +56,14 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
39
56
|
until?: string;
|
|
40
57
|
}, any, Name>;
|
|
41
58
|
};
|
|
59
|
+
metadata: {
|
|
60
|
+
updateMediaMeta: FunctionReference<"mutation", "internal", {
|
|
61
|
+
alt?: string;
|
|
62
|
+
key: string;
|
|
63
|
+
tags?: Array<string>;
|
|
64
|
+
title?: string;
|
|
65
|
+
}, any, Name>;
|
|
66
|
+
};
|
|
42
67
|
public: {
|
|
43
68
|
createMedia: FunctionReference<"mutation", "internal", {
|
|
44
69
|
contentType: string;
|
|
@@ -78,6 +103,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
78
103
|
}, any, Name>;
|
|
79
104
|
issueViewerToken: FunctionReference<"action", "internal", {
|
|
80
105
|
sessionSecret?: string;
|
|
106
|
+
userId?: string;
|
|
81
107
|
}, any, Name>;
|
|
82
108
|
listCaptionsByMedia: FunctionReference<"query", "internal", {
|
|
83
109
|
mediaKey: string;
|
|
@@ -147,6 +173,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
147
173
|
filename?: string;
|
|
148
174
|
height?: number;
|
|
149
175
|
key: string;
|
|
176
|
+
pageCount?: number;
|
|
150
177
|
width?: number;
|
|
151
178
|
}, any, Name>;
|
|
152
179
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/component/_generated/component.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,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