@depup/uploadthing 7.7.4-depup.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 (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +33 -0
  3. package/changes.json +18 -0
  4. package/client/index.cjs +331 -0
  5. package/client/index.d.cts +36 -0
  6. package/client/index.d.cts.map +1 -0
  7. package/client/index.d.ts +36 -0
  8. package/client/index.d.ts.map +1 -0
  9. package/client/index.js +286 -0
  10. package/client/index.js.map +1 -0
  11. package/client-future/index.cjs +426 -0
  12. package/client-future/index.d.cts +373 -0
  13. package/client-future/index.d.cts.map +1 -0
  14. package/client-future/index.d.ts +373 -0
  15. package/client-future/index.d.ts.map +1 -0
  16. package/client-future/index.js +383 -0
  17. package/client-future/index.js.map +1 -0
  18. package/dist/chunk-CUT6urMc.cjs +30 -0
  19. package/dist/deprecations-DPGpmqha.cjs +13 -0
  20. package/dist/deprecations-pLmw6Ytd.js +8 -0
  21. package/dist/deprecations-pLmw6Ytd.js.map +1 -0
  22. package/dist/package-BQ_k22T9.cjs +11 -0
  23. package/dist/package-DpScpvTA.js +6 -0
  24. package/dist/package-DpScpvTA.js.map +1 -0
  25. package/dist/shared-schemas-BmG5ARoX.js +82 -0
  26. package/dist/shared-schemas-BmG5ARoX.js.map +1 -0
  27. package/dist/shared-schemas-CG9VaBtT.cjs +129 -0
  28. package/dist/to-web-request-BQtxSXgE.cjs +98 -0
  29. package/dist/to-web-request-DhP0wXG-.js +87 -0
  30. package/dist/to-web-request-DhP0wXG-.js.map +1 -0
  31. package/dist/types-Bs3w2d_3.d.ts +627 -0
  32. package/dist/types-Bs3w2d_3.d.ts.map +1 -0
  33. package/dist/types-DiVC1t2V.d.cts +625 -0
  34. package/dist/types-DiVC1t2V.d.cts.map +1 -0
  35. package/dist/upload-builder-BUa7tovh.d.cts +32 -0
  36. package/dist/upload-builder-BUa7tovh.d.cts.map +1 -0
  37. package/dist/upload-builder-BcFawEj0.d.ts +32 -0
  38. package/dist/upload-builder-BcFawEj0.d.ts.map +1 -0
  39. package/dist/upload-builder-BlFOAnsv.js +699 -0
  40. package/dist/upload-builder-BlFOAnsv.js.map +1 -0
  41. package/dist/upload-builder-D6Ken9H0.cjs +794 -0
  42. package/dist/ut-reporter-BHoyNnzW.cjs +120 -0
  43. package/dist/ut-reporter-Dlppchbx.js +103 -0
  44. package/dist/ut-reporter-Dlppchbx.js.map +1 -0
  45. package/effect-platform/index.cjs +22 -0
  46. package/effect-platform/index.d.cts +54 -0
  47. package/effect-platform/index.d.cts.map +1 -0
  48. package/effect-platform/index.d.ts +54 -0
  49. package/effect-platform/index.d.ts.map +1 -0
  50. package/effect-platform/index.js +19 -0
  51. package/effect-platform/index.js.map +1 -0
  52. package/express/index.cjs +30 -0
  53. package/express/index.d.cts +28 -0
  54. package/express/index.d.cts.map +1 -0
  55. package/express/index.d.ts +28 -0
  56. package/express/index.d.ts.map +1 -0
  57. package/express/index.js +27 -0
  58. package/express/index.js.map +1 -0
  59. package/fastify/index.cjs +27 -0
  60. package/fastify/index.d.cts +28 -0
  61. package/fastify/index.d.cts.map +1 -0
  62. package/fastify/index.d.ts +28 -0
  63. package/fastify/index.d.ts.map +1 -0
  64. package/fastify/index.js +24 -0
  65. package/fastify/index.js.map +1 -0
  66. package/h3/index.cjs +20 -0
  67. package/h3/index.d.cts +28 -0
  68. package/h3/index.d.cts.map +1 -0
  69. package/h3/index.d.ts +28 -0
  70. package/h3/index.d.ts.map +1 -0
  71. package/h3/index.js +17 -0
  72. package/h3/index.js.map +1 -0
  73. package/next/index.cjs +22 -0
  74. package/next/index.d.cts +30 -0
  75. package/next/index.d.cts.map +1 -0
  76. package/next/index.d.ts +30 -0
  77. package/next/index.d.ts.map +1 -0
  78. package/next/index.js +19 -0
  79. package/next/index.js.map +1 -0
  80. package/next-legacy/index.cjs +28 -0
  81. package/next-legacy/index.d.cts +28 -0
  82. package/next-legacy/index.d.cts.map +1 -0
  83. package/next-legacy/index.d.ts +28 -0
  84. package/next-legacy/index.d.ts.map +1 -0
  85. package/next-legacy/index.js +25 -0
  86. package/next-legacy/index.js.map +1 -0
  87. package/package.json +210 -0
  88. package/remix/index.cjs +22 -0
  89. package/remix/index.d.cts +30 -0
  90. package/remix/index.d.cts.map +1 -0
  91. package/remix/index.d.ts +30 -0
  92. package/remix/index.d.ts.map +1 -0
  93. package/remix/index.js +19 -0
  94. package/remix/index.js.map +1 -0
  95. package/server/index.cjs +414 -0
  96. package/server/index.d.cts +211 -0
  97. package/server/index.d.cts.map +1 -0
  98. package/server/index.d.ts +213 -0
  99. package/server/index.d.ts.map +1 -0
  100. package/server/index.js +405 -0
  101. package/server/index.js.map +1 -0
  102. package/tw/index.cjs +70 -0
  103. package/tw/index.d.cts +29 -0
  104. package/tw/index.d.cts.map +1 -0
  105. package/tw/index.d.ts +29 -0
  106. package/tw/index.d.ts.map +1 -0
  107. package/tw/index.js +74 -0
  108. package/tw/index.js.map +1 -0
  109. package/tw/v4.css +11 -0
  110. package/types/index.cjs +3 -0
  111. package/types/index.d.cts +2 -0
  112. package/types/index.d.ts +2 -0
  113. package/types/index.js +3 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Ping Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @depup/uploadthing
2
+
3
+ > Dependency-bumped version of [uploadthing](https://www.npmjs.com/package/uploadthing)
4
+
5
+ Generated by [DepUp](https://github.com/depup/npm) -- all production
6
+ dependencies bumped to latest versions.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @depup/uploadthing
12
+ ```
13
+
14
+ | Field | Value |
15
+ |-------|-------|
16
+ | Original | [uploadthing](https://www.npmjs.com/package/uploadthing) @ 7.7.4 |
17
+ | Processed | 2026-03-18 |
18
+ | Smoke test | failed |
19
+ | Deps updated | 3 |
20
+
21
+ ## Dependency Changes
22
+
23
+ | Dependency | From | To |
24
+ |------------|------|-----|
25
+ | @effect/platform | 0.90.3 | ^0.95.0 |
26
+ | @standard-schema/spec | 1.0.0-beta.4 | ^1.1.0 |
27
+ | effect | 3.17.7 | ^3.20.0 |
28
+
29
+ ---
30
+
31
+ Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/uploadthing
32
+
33
+ License inherited from the original package.
package/changes.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "bumped": {
3
+ "@effect/platform": {
4
+ "from": "0.90.3",
5
+ "to": "^0.95.0"
6
+ },
7
+ "@standard-schema/spec": {
8
+ "from": "1.0.0-beta.4",
9
+ "to": "^1.1.0"
10
+ },
11
+ "effect": {
12
+ "from": "3.17.7",
13
+ "to": "^3.20.0"
14
+ }
15
+ },
16
+ "timestamp": "2026-03-18T23:28:09.409Z",
17
+ "totalUpdated": 3
18
+ }
@@ -0,0 +1,331 @@
1
+ const require_chunk = require('../dist/chunk-CUT6urMc.cjs');
2
+ const require_package = require('../dist/package-BQ_k22T9.cjs');
3
+ const require_ut_reporter = require('../dist/ut-reporter-BHoyNnzW.cjs');
4
+ const require_deprecations = require('../dist/deprecations-DPGpmqha.cjs');
5
+ const effect_Array = require_chunk.__toESM(require("effect/Array"));
6
+ const effect_Micro = require_chunk.__toESM(require("effect/Micro"));
7
+ const __uploadthing_shared = require_chunk.__toESM(require("@uploadthing/shared"));
8
+ const effect_Function = require_chunk.__toESM(require("effect/Function"));
9
+ const effect_Predicate = require_chunk.__toESM(require("effect/Predicate"));
10
+
11
+ //#region src/_internal/upload-browser.ts
12
+ const uploadWithProgress = (file, rangeStart, presigned, opts) => effect_Micro.async((resume) => {
13
+ const xhr = new XMLHttpRequest();
14
+ xhr.open("PUT", presigned.url, true);
15
+ xhr.setRequestHeader("Range", `bytes=${rangeStart}-`);
16
+ xhr.setRequestHeader("x-uploadthing-version", require_package.version);
17
+ xhr.setRequestHeader("b3", opts.traceHeaders.b3);
18
+ xhr.setRequestHeader("traceparent", opts.traceHeaders.traceparent);
19
+ xhr.responseType = "json";
20
+ let previousLoaded = 0;
21
+ xhr.upload.addEventListener("progress", ({ loaded }) => {
22
+ const delta = loaded - previousLoaded;
23
+ opts.onUploadProgress?.({
24
+ loaded,
25
+ delta
26
+ });
27
+ previousLoaded = loaded;
28
+ });
29
+ xhr.addEventListener("load", () => {
30
+ if (xhr.status >= 200 && xhr.status < 300 && (0, effect_Predicate.isRecord)(xhr.response)) if ((0, effect_Predicate.hasProperty)(xhr.response, "error")) resume(new __uploadthing_shared.UploadThingError({
31
+ code: "UPLOAD_FAILED",
32
+ message: String(xhr.response.error),
33
+ data: xhr.response
34
+ }));
35
+ else resume(effect_Micro.succeed(xhr.response));
36
+ else resume(new __uploadthing_shared.UploadThingError({
37
+ code: "UPLOAD_FAILED",
38
+ message: `XHR failed ${xhr.status} ${xhr.statusText}`,
39
+ data: xhr.response
40
+ }));
41
+ });
42
+ xhr.addEventListener("error", () => {
43
+ resume(new __uploadthing_shared.UploadThingError({ code: "UPLOAD_FAILED" }));
44
+ });
45
+ const formData = new FormData();
46
+ /**
47
+ * iOS/React Native FormData handling requires special attention:
48
+ *
49
+ * Issue: In React Native, iOS crashes with "attempt to insert nil object" when appending File directly
50
+ * to FormData. This happens because iOS tries to create NSDictionary from the file object and expects
51
+ * specific structure {uri, type, name}.
52
+ *
53
+ *
54
+ * Note: Don't try to use Blob or modify File object - iOS specifically needs plain object
55
+ * with these properties to create valid NSDictionary.
56
+ */
57
+ if ("uri" in file) formData.append("file", {
58
+ uri: file.uri,
59
+ type: file.type,
60
+ name: file.name,
61
+ ...rangeStart > 0 && { range: rangeStart }
62
+ });
63
+ else formData.append("file", rangeStart > 0 ? file.slice(rangeStart) : file);
64
+ xhr.send(formData);
65
+ return effect_Micro.sync(() => xhr.abort());
66
+ });
67
+ const uploadFile = (file, presigned, opts) => (0, __uploadthing_shared.fetchEff)(presigned.url, {
68
+ method: "HEAD",
69
+ headers: opts.traceHeaders
70
+ }).pipe(effect_Micro.map(({ headers }) => parseInt(headers.get("x-ut-range-start") ?? "0", 10)), effect_Micro.tap((start) => opts.onUploadProgress?.({
71
+ delta: start,
72
+ loaded: start
73
+ })), effect_Micro.flatMap((start) => uploadWithProgress(file, start, presigned, {
74
+ traceHeaders: opts.traceHeaders,
75
+ onUploadProgress: (progressEvent) => opts.onUploadProgress?.({
76
+ delta: progressEvent.delta,
77
+ loaded: progressEvent.loaded + start
78
+ })
79
+ })), effect_Micro.map(effect_Function.unsafeCoerce), effect_Micro.map((uploadResponse) => ({
80
+ name: file.name,
81
+ size: file.size,
82
+ key: presigned.key,
83
+ lastModified: file.lastModified,
84
+ serverData: uploadResponse.serverData,
85
+ get url() {
86
+ require_deprecations.logDeprecationWarning("`file.url` is deprecated and will be removed in uploadthing v9. Use `file.ufsUrl` instead.");
87
+ return uploadResponse.url;
88
+ },
89
+ get appUrl() {
90
+ require_deprecations.logDeprecationWarning("`file.appUrl` is deprecated and will be removed in uploadthing v9. Use `file.ufsUrl` instead.");
91
+ return uploadResponse.appUrl;
92
+ },
93
+ ufsUrl: uploadResponse.ufsUrl,
94
+ customId: presigned.customId,
95
+ type: file.type,
96
+ fileHash: uploadResponse.fileHash
97
+ })));
98
+ const uploadFilesInternal = (endpoint, opts) => {
99
+ const traceHeaders = require_ut_reporter.generateTraceHeaders();
100
+ const reportEventToUT = require_ut_reporter.createUTReporter({
101
+ endpoint: String(endpoint),
102
+ package: opts.package,
103
+ url: opts.url,
104
+ headers: opts.headers,
105
+ traceHeaders
106
+ });
107
+ const totalSize = opts.files.reduce((acc, f) => acc + f.size, 0);
108
+ let totalLoaded = 0;
109
+ return effect_Micro.flatMap(reportEventToUT("upload", {
110
+ input: "input" in opts ? opts.input : null,
111
+ files: opts.files.map((f) => ({
112
+ name: f.name,
113
+ size: f.size,
114
+ type: f.type,
115
+ lastModified: f.lastModified
116
+ }))
117
+ }), (presigneds) => effect_Micro.forEach(presigneds, (presigned, i) => effect_Micro.flatMap(effect_Micro.sync(() => opts.onUploadBegin?.({ file: opts.files[i].name })), () => uploadFile(opts.files[i], presigned, {
118
+ traceHeaders,
119
+ onUploadProgress: (ev) => {
120
+ totalLoaded += ev.delta;
121
+ opts.onUploadProgress?.({
122
+ file: opts.files[i],
123
+ progress: ev.loaded / opts.files[i].size * 100,
124
+ loaded: ev.loaded,
125
+ delta: ev.delta,
126
+ totalLoaded,
127
+ totalProgress: totalLoaded / totalSize
128
+ });
129
+ }
130
+ })), { concurrency: 6 }));
131
+ };
132
+
133
+ //#endregion
134
+ //#region src/client.ts
135
+ const version$1 = require_package.version;
136
+ /**
137
+ * Validate that a file is of a valid type given a route config
138
+ * @public
139
+ */
140
+ const isValidFileType = (file, routeConfig) => effect_Micro.runSync((0, __uploadthing_shared.matchFileType)(file, (0, __uploadthing_shared.objectKeys)(routeConfig)).pipe(effect_Micro.map((type) => file.type.includes(type)), effect_Micro.orElseSucceed(() => false)));
141
+ /**
142
+ * Validate that a file is of a valid size given a route config
143
+ * @public
144
+ */
145
+ const isValidFileSize = (file, routeConfig) => effect_Micro.runSync((0, __uploadthing_shared.matchFileType)(file, (0, __uploadthing_shared.objectKeys)(routeConfig)).pipe(effect_Micro.flatMap((type) => (0, __uploadthing_shared.fileSizeToBytes)(routeConfig[type].maxFileSize)), effect_Micro.map((maxFileSize) => file.size <= maxFileSize), effect_Micro.orElseSucceed(() => false)));
146
+ /**
147
+ * Generate a typed uploader for a given FileRouter
148
+ * @public
149
+ */
150
+ const genUploader = (initOpts) => {
151
+ const routeRegistry = (0, __uploadthing_shared.createIdentityProxy)();
152
+ const controllableUpload = async (slug, opts) => {
153
+ const uploads = /* @__PURE__ */ new Map();
154
+ const endpoint = typeof slug === "function" ? slug(routeRegistry) : slug;
155
+ const traceHeaders = require_ut_reporter.generateTraceHeaders();
156
+ const utReporter = require_ut_reporter.createUTReporter({
157
+ endpoint: String(endpoint),
158
+ package: initOpts?.package ?? "uploadthing/client",
159
+ url: (0, __uploadthing_shared.resolveMaybeUrlArg)(initOpts?.url),
160
+ headers: opts.headers,
161
+ traceHeaders
162
+ });
163
+ const fetchFn = initOpts?.fetch ?? window.fetch;
164
+ const presigneds = await effect_Micro.runPromise(utReporter("upload", {
165
+ input: "input" in opts ? opts.input : null,
166
+ files: opts.files.map((f) => ({
167
+ name: f.name,
168
+ size: f.size,
169
+ type: f.type,
170
+ lastModified: f.lastModified
171
+ }))
172
+ }).pipe(effect_Micro.provideService(__uploadthing_shared.FetchContext, fetchFn)));
173
+ const totalSize = opts.files.reduce((acc, f) => acc + f.size, 0);
174
+ let totalLoaded = 0;
175
+ const uploadEffect = (file, presigned) => uploadFile(file, presigned, {
176
+ traceHeaders,
177
+ onUploadProgress: (progressEvent) => {
178
+ totalLoaded += progressEvent.delta;
179
+ opts.onUploadProgress?.({
180
+ ...progressEvent,
181
+ file,
182
+ progress: Math.round(progressEvent.loaded / file.size * 100),
183
+ totalLoaded,
184
+ totalProgress: Math.round(totalLoaded / totalSize * 100)
185
+ });
186
+ }
187
+ }).pipe(effect_Micro.provideService(__uploadthing_shared.FetchContext, fetchFn));
188
+ for (const [i, p] of presigneds.entries()) {
189
+ const file = opts.files[i];
190
+ if (!file) continue;
191
+ const deferred = require_ut_reporter.createDeferred();
192
+ uploads.set(file, {
193
+ deferred,
194
+ presigned: p
195
+ });
196
+ effect_Micro.runPromiseExit(uploadEffect(file, p), { signal: deferred.ac.signal }).then((result) => {
197
+ if (result._tag === "Success") return deferred.resolve(result.value);
198
+ else if (result.cause._tag === "Interrupt") throw new __uploadthing_shared.UploadPausedError();
199
+ throw effect_Micro.causeSquash(result.cause);
200
+ }).catch((err) => {
201
+ if (err instanceof __uploadthing_shared.UploadPausedError) return;
202
+ deferred.reject(err);
203
+ });
204
+ }
205
+ /**
206
+ * Pause an ongoing upload
207
+ * @param file The file upload you want to pause. Can be omitted to pause all files
208
+ */
209
+ const pauseUpload = (file) => {
210
+ const files = effect_Array.ensure(file ?? opts.files);
211
+ for (const file$1 of files) {
212
+ const upload = uploads.get(file$1);
213
+ if (!upload) return;
214
+ if (upload.deferred.ac.signal.aborted) throw new __uploadthing_shared.UploadAbortedError();
215
+ upload.deferred.ac.abort();
216
+ }
217
+ };
218
+ /**
219
+ * Resume a paused upload
220
+ * @param file The file upload you want to resume. Can be omitted to resume all files
221
+ */
222
+ const resumeUpload = (file) => {
223
+ const files = effect_Array.ensure(file ?? opts.files);
224
+ for (const file$1 of files) {
225
+ const upload = uploads.get(file$1);
226
+ if (!upload) throw "No upload found";
227
+ upload.deferred.ac = new AbortController();
228
+ effect_Micro.runPromiseExit(uploadEffect(file$1, upload.presigned), { signal: upload.deferred.ac.signal }).then((result) => {
229
+ if (result._tag === "Success") return upload.deferred.resolve(result.value);
230
+ else if (result.cause._tag === "Interrupt") throw new __uploadthing_shared.UploadPausedError();
231
+ throw effect_Micro.causeSquash(result.cause);
232
+ }).catch((err) => {
233
+ if (err instanceof __uploadthing_shared.UploadPausedError) return;
234
+ upload.deferred.reject(err);
235
+ });
236
+ }
237
+ };
238
+ /**
239
+ * Wait for an upload to complete
240
+ * @param file The file upload you want to wait for. Can be omitted to wait for all files
241
+ */
242
+ const done = async (file) => {
243
+ const promises = [];
244
+ const files = effect_Array.ensure(file ?? opts.files);
245
+ for (const file$1 of files) {
246
+ const upload = uploads.get(file$1);
247
+ if (!upload) throw "No upload found";
248
+ promises.push(upload.deferred.promise);
249
+ }
250
+ const results = await Promise.all(promises);
251
+ return file ? results[0] : results;
252
+ };
253
+ return {
254
+ pauseUpload,
255
+ resumeUpload,
256
+ done
257
+ };
258
+ };
259
+ /**
260
+ * One step upload function that both requests presigned URLs
261
+ * and then uploads the files to UploadThing
262
+ */
263
+ const typedUploadFiles = (slug, opts) => {
264
+ const endpoint = typeof slug === "function" ? slug(routeRegistry) : slug;
265
+ const fetchFn = initOpts?.fetch ?? window.fetch;
266
+ return uploadFilesInternal(endpoint, {
267
+ ...opts,
268
+ skipPolling: {},
269
+ url: (0, __uploadthing_shared.resolveMaybeUrlArg)(initOpts?.url),
270
+ package: initOpts?.package ?? "uploadthing/client",
271
+ input: opts.input
272
+ }).pipe(effect_Micro.provideService(__uploadthing_shared.FetchContext, fetchFn), (effect) => effect_Micro.runPromiseExit(effect, opts.signal && { signal: opts.signal })).then((exit) => {
273
+ if (exit._tag === "Success") return exit.value;
274
+ else if (exit.cause._tag === "Interrupt") throw new __uploadthing_shared.UploadAbortedError();
275
+ throw effect_Micro.causeSquash(exit.cause);
276
+ });
277
+ };
278
+ return {
279
+ uploadFiles: typedUploadFiles,
280
+ createUpload: controllableUpload,
281
+ routeRegistry
282
+ };
283
+ };
284
+
285
+ //#endregion
286
+ Object.defineProperty(exports, 'UploadAbortedError', {
287
+ enumerable: true,
288
+ get: function () {
289
+ return __uploadthing_shared.UploadAbortedError;
290
+ }
291
+ });
292
+ Object.defineProperty(exports, 'UploadPausedError', {
293
+ enumerable: true,
294
+ get: function () {
295
+ return __uploadthing_shared.UploadPausedError;
296
+ }
297
+ });
298
+ Object.defineProperty(exports, 'allowedContentTextLabelGenerator', {
299
+ enumerable: true,
300
+ get: function () {
301
+ return __uploadthing_shared.allowedContentTextLabelGenerator;
302
+ }
303
+ });
304
+ Object.defineProperty(exports, 'bytesToFileSize', {
305
+ enumerable: true,
306
+ get: function () {
307
+ return __uploadthing_shared.bytesToFileSize;
308
+ }
309
+ });
310
+ exports.genUploader = genUploader;
311
+ Object.defineProperty(exports, 'generateClientDropzoneAccept', {
312
+ enumerable: true,
313
+ get: function () {
314
+ return __uploadthing_shared.generateClientDropzoneAccept;
315
+ }
316
+ });
317
+ Object.defineProperty(exports, 'generateMimeTypes', {
318
+ enumerable: true,
319
+ get: function () {
320
+ return __uploadthing_shared.generateMimeTypes;
321
+ }
322
+ });
323
+ Object.defineProperty(exports, 'generatePermittedFileTypes', {
324
+ enumerable: true,
325
+ get: function () {
326
+ return __uploadthing_shared.generatePermittedFileTypes;
327
+ }
328
+ });
329
+ exports.isValidFileSize = isValidFileSize;
330
+ exports.isValidFileType = isValidFileType;
331
+ exports.version = version$1;
@@ -0,0 +1,36 @@
1
+ import { ClientUploadedFileData, CreateUploadOptions, EndpointArg, FileRouter, GenerateUploaderOptions, RouteRegistry, UploadFilesOptions, inferEndpointOutput } from "../dist/types-DiVC1t2V.cjs";
2
+ import { ExpandedRouteConfig, UploadAbortedError, UploadPausedError, allowedContentTextLabelGenerator, bytesToFileSize, generateClientDropzoneAccept, generateMimeTypes, generatePermittedFileTypes } from "@uploadthing/shared";
3
+
4
+ //#region src/client.d.ts
5
+ declare const version: string;
6
+ /**
7
+ * Validate that a file is of a valid type given a route config
8
+ * @public
9
+ */
10
+ declare const isValidFileType: (file: File, routeConfig: ExpandedRouteConfig) => boolean;
11
+ /**
12
+ * Validate that a file is of a valid size given a route config
13
+ * @public
14
+ */
15
+ declare const isValidFileSize: (file: File, routeConfig: ExpandedRouteConfig) => boolean;
16
+ /**
17
+ * Generate a typed uploader for a given FileRouter
18
+ * @public
19
+ */
20
+ declare const genUploader: <TRouter extends FileRouter>(initOpts?: GenerateUploaderOptions) => {
21
+ uploadFiles: <TEndpoint extends keyof TRouter>(slug: EndpointArg<TRouter, TEndpoint>, opts: Omit<UploadFilesOptions<TRouter[TEndpoint]>, keyof GenerateUploaderOptions>) => Promise<ClientUploadedFileData<inferEndpointOutput<TRouter[TEndpoint]>>[]>;
22
+ createUpload: <TEndpoint extends keyof TRouter, TServerOutput = inferEndpointOutput<TRouter[TEndpoint]>>(slug: EndpointArg<TRouter, TEndpoint>, opts: Omit<CreateUploadOptions<TRouter[TEndpoint]>, keyof GenerateUploaderOptions>) => Promise<{
23
+ pauseUpload: (file?: File) => void;
24
+ resumeUpload: (file?: File) => void;
25
+ done: <T extends File | void = void>(file?: T) => Promise<T extends File ? ClientUploadedFileData<TServerOutput> : ClientUploadedFileData<TServerOutput>[]>;
26
+ }>;
27
+ /**
28
+ * Identity object that can be used instead of raw strings
29
+ * that allows "Go to definition" in your IDE to bring you
30
+ * to the backend definition of a route.
31
+ */
32
+ routeRegistry: RouteRegistry<TRouter>;
33
+ };
34
+ //#endregion
35
+ export { UploadAbortedError, UploadPausedError, allowedContentTextLabelGenerator, bytesToFileSize, genUploader, generateClientDropzoneAccept, generateMimeTypes, generatePermittedFileTypes, isValidFileSize, isValidFileType, version };
36
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/client.ts"],"sourcesContent":[],"mappings":";;;;cAkCa;;;;;AAiOH,cA1MG,eA0MH,EAAA,CAAA,IAAA,EAzMF,IAyME,EAAA,WAAA,EAxMK,mBAwML,EAAA,GAAA,OAAA;;;;;AACA,cA5LG,eA4LH,EAAA,CAAA,IAAA,EA3LF,IA2LE,EAAA,WAAA,EA1LK,mBA0LL,EAAA,GAAA,OAAA;;;;;AAGL,cA/KQ,WA+KR,EAAA,CAAA,gBA/KuC,UA+KvC,CAAA,CAAA,QAAA,CAAA,EA9KQ,uBA8KR,EAAA,GAAA;EAAA,WAzKuB,EAAA,CAAA,kBAAA,MAoKwB,OApKxB,CAAA,CAAA,IAAA,EAqKlB,WArKkB,CAqKN,OArKM,EAqKG,SArKH,CAAA,EAAA,IAAA,EAsKlB,IAtKkB,CAuKtB,kBAvKsB,CAuKH,OAvKG,CAuKK,SAvKL,CAAA,CAAA,EAAA,MAwKhB,uBAxKgB,CAAA,EAAA,GAyKvB,OAzKuB,CAyKvB,sBAzKuB,CAyKvB,mBAzKuB,CAyKvB,OAzKuB,CAyKvB,SAzKuB,CAAA,CAAA,CAAA,EAAA,CAAA;EAAO,YAClB,EAAA,CAAA,kBAAA,MADW,OACX,EAAA,gBAAA,mBAAA,CAAA,OAAA,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAEP,WAFO,CAEK,OAFL,EAEc,SAFd,CAAA,EAAA,IAAA,EAGP,IAHO,CAIX,mBAJW,CAIS,OAJT,CAIiB,SAJjB,CAAA,CAAA,EAAA,MAKL,uBALK,CAAA,EAAA,GAMZ,OANY,CAAA;IAAA,WAAA,EAAA,CAAA,IAAA,CAAA,EAuFe,IAvFf,EAAA,GAAA,IAAA;IAAA,YAAA,EAAA,CAAA,IAAA,CAAA,EA0GgB,IA1GhB,EAAA,GAAA,IAAA;IAEK,IAAA,EAAA,CAAA,UAqIY,IArIZ,GAAA,IAAA,GAAA,IAAA,CAAA,CAAA,IAAA,CAAA,EAsIT,CAtIS,EAAA,GAuIf,OAvIe,CAwIhB,CAxIgB,SAwIN,IAxIM,GAyIZ,sBAzIY,CAyIW,aAzIX,CAAA,GA0IZ,sBA1IY,CA0IW,aA1IX,CAAA,EAAA,CAAA;EAAO,CAAA,CAAA;EAAW;;;;;EAGL,aAFzB,eAAA,CAGL,OAHK,CAAA;CAAI"}
@@ -0,0 +1,36 @@
1
+ import { ClientUploadedFileData, CreateUploadOptions, EndpointArg, FileRouter, GenerateUploaderOptions, RouteRegistry, UploadFilesOptions, inferEndpointOutput } from "../dist/types-Bs3w2d_3.js";
2
+ import { ExpandedRouteConfig, UploadAbortedError, UploadPausedError, allowedContentTextLabelGenerator, bytesToFileSize, generateClientDropzoneAccept, generateMimeTypes, generatePermittedFileTypes } from "@uploadthing/shared";
3
+
4
+ //#region src/client.d.ts
5
+ declare const version: string;
6
+ /**
7
+ * Validate that a file is of a valid type given a route config
8
+ * @public
9
+ */
10
+ declare const isValidFileType: (file: File, routeConfig: ExpandedRouteConfig) => boolean;
11
+ /**
12
+ * Validate that a file is of a valid size given a route config
13
+ * @public
14
+ */
15
+ declare const isValidFileSize: (file: File, routeConfig: ExpandedRouteConfig) => boolean;
16
+ /**
17
+ * Generate a typed uploader for a given FileRouter
18
+ * @public
19
+ */
20
+ declare const genUploader: <TRouter extends FileRouter>(initOpts?: GenerateUploaderOptions) => {
21
+ uploadFiles: <TEndpoint extends keyof TRouter>(slug: EndpointArg<TRouter, TEndpoint>, opts: Omit<UploadFilesOptions<TRouter[TEndpoint]>, keyof GenerateUploaderOptions>) => Promise<ClientUploadedFileData<inferEndpointOutput<TRouter[TEndpoint]>>[]>;
22
+ createUpload: <TEndpoint extends keyof TRouter, TServerOutput = inferEndpointOutput<TRouter[TEndpoint]>>(slug: EndpointArg<TRouter, TEndpoint>, opts: Omit<CreateUploadOptions<TRouter[TEndpoint]>, keyof GenerateUploaderOptions>) => Promise<{
23
+ pauseUpload: (file?: File) => void;
24
+ resumeUpload: (file?: File) => void;
25
+ done: <T extends File | void = void>(file?: T) => Promise<T extends File ? ClientUploadedFileData<TServerOutput> : ClientUploadedFileData<TServerOutput>[]>;
26
+ }>;
27
+ /**
28
+ * Identity object that can be used instead of raw strings
29
+ * that allows "Go to definition" in your IDE to bring you
30
+ * to the backend definition of a route.
31
+ */
32
+ routeRegistry: RouteRegistry<TRouter>;
33
+ };
34
+ //#endregion
35
+ export { UploadAbortedError, UploadPausedError, allowedContentTextLabelGenerator, bytesToFileSize, genUploader, generateClientDropzoneAccept, generateMimeTypes, generatePermittedFileTypes, isValidFileSize, isValidFileType, version };
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/client.ts"],"sourcesContent":[],"mappings":";;;;cAkCa;;;;;AAiOH,cA1MG,eA0MH,EAAA,CAAA,IAAA,EAzMF,IAyME,EAAA,WAAA,EAxMK,mBAwML,EAAA,GAAA,OAAA;;;;;AACA,cA5LG,eA4LH,EAAA,CAAA,IAAA,EA3LF,IA2LE,EAAA,WAAA,EA1LK,mBA0LL,EAAA,GAAA,OAAA;;;;;AAGL,cA/KQ,WA+KR,EAAA,CAAA,gBA/KuC,UA+KvC,CAAA,CAAA,QAAA,CAAA,EA9KQ,uBA8KR,EAAA,GAAA;EAAA,WAzKuB,EAAA,CAAA,kBAAA,MAoKwB,OApKxB,CAAA,CAAA,IAAA,EAqKlB,WArKkB,CAqKN,OArKM,EAqKG,SArKH,CAAA,EAAA,IAAA,EAsKlB,IAtKkB,CAuKtB,kBAvKsB,CAuKH,OAvKG,CAuKK,SAvKL,CAAA,CAAA,EAAA,MAwKhB,uBAxKgB,CAAA,EAAA,GAyKvB,OAzKuB,CAyKvB,sBAzKuB,CAyKvB,mBAzKuB,CAyKvB,OAzKuB,CAyKvB,SAzKuB,CAAA,CAAA,CAAA,EAAA,CAAA;EAAO,YAClB,EAAA,CAAA,kBAAA,MADW,OACX,EAAA,gBAAA,mBAAA,CAAA,OAAA,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,IAAA,EAEP,WAFO,CAEK,OAFL,EAEc,SAFd,CAAA,EAAA,IAAA,EAGP,IAHO,CAIX,mBAJW,CAIS,OAJT,CAIiB,SAJjB,CAAA,CAAA,EAAA,MAKL,uBALK,CAAA,EAAA,GAMZ,OANY,CAAA;IAAA,WAAA,EAAA,CAAA,IAAA,CAAA,EAuFe,IAvFf,EAAA,GAAA,IAAA;IAAA,YAAA,EAAA,CAAA,IAAA,CAAA,EA0GgB,IA1GhB,EAAA,GAAA,IAAA;IAEK,IAAA,EAAA,CAAA,UAqIY,IArIZ,GAAA,IAAA,GAAA,IAAA,CAAA,CAAA,IAAA,CAAA,EAsIT,CAtIS,EAAA,GAuIf,OAvIe,CAwIhB,CAxIgB,SAwIN,IAxIM,GAyIZ,sBAzIY,CAyIW,aAzIX,CAAA,GA0IZ,sBA1IY,CA0IW,aA1IX,CAAA,EAAA,CAAA;EAAO,CAAA,CAAA;EAAW;;;;;EAGL,aAFzB,eAAA,CAGL,OAHK,CAAA;CAAI"}