@sparkstudio/storage-ui 1.0.19 → 1.0.20
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/index.cjs +3 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1079,7 +1079,7 @@ var SingleFileProcessUploader = ({ getPresignedUrl, onUploadComplete, accept, la
|
|
|
1079
1079
|
setProgress(0);
|
|
1080
1080
|
setErrorMessage(null);
|
|
1081
1081
|
const presignedUrl = await getPresignedUrl(selectedFile);
|
|
1082
|
-
await UploadFileToS3(selectedFile, presignedUrl, (p) => setProgress(p));
|
|
1082
|
+
await UploadFileToS3(selectedFile, presignedUrl?.PresignedUrl ?? "", (p) => setProgress(p));
|
|
1083
1083
|
setStatus("success");
|
|
1084
1084
|
onUploadComplete?.(selectedFile, presignedUrl);
|
|
1085
1085
|
} catch (err) {
|
|
@@ -1214,7 +1214,8 @@ function HomeContent() {
|
|
|
1214
1214
|
"https://localhost:5001"
|
|
1215
1215
|
);
|
|
1216
1216
|
const contentType = file.type || "application/octet-stream";
|
|
1217
|
-
|
|
1217
|
+
const result = await res.s3.GetTemporaryPreSignedUrl(new TemporaryFileDTO({ Name: file.name, ContentType: contentType }));
|
|
1218
|
+
return result;
|
|
1218
1219
|
}
|
|
1219
1220
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1220
1221
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_authentication_ui.UserInfoCard, {}),
|
package/dist/index.d.cts
CHANGED
|
@@ -133,13 +133,13 @@ declare const DesktopFileIcon: React__default.FC<DesktopFileIconProps>;
|
|
|
133
133
|
|
|
134
134
|
interface SingleFileProcessUploaderProps {
|
|
135
135
|
/** Called to get a presigned S3 URL for the selected file. */
|
|
136
|
-
getPresignedUrl: (file: File) => Promise<
|
|
136
|
+
getPresignedUrl: (file: File) => Promise<AWSPresignedUrlDTO>;
|
|
137
137
|
/**
|
|
138
138
|
* Called after the upload succeeds.
|
|
139
139
|
* You can use s3Url (the presigned URL you provided) in another component
|
|
140
140
|
* or have your backend process the file from S3.
|
|
141
141
|
*/
|
|
142
|
-
onUploadComplete?: (file: File, s3Url:
|
|
142
|
+
onUploadComplete?: (file: File, s3Url: AWSPresignedUrlDTO) => void;
|
|
143
143
|
/** Optional: restrict file types, e.g. "image/*" or ".png,.jpg" */
|
|
144
144
|
accept?: string;
|
|
145
145
|
/** Optional: label shown above the control */
|
package/dist/index.d.ts
CHANGED
|
@@ -133,13 +133,13 @@ declare const DesktopFileIcon: React__default.FC<DesktopFileIconProps>;
|
|
|
133
133
|
|
|
134
134
|
interface SingleFileProcessUploaderProps {
|
|
135
135
|
/** Called to get a presigned S3 URL for the selected file. */
|
|
136
|
-
getPresignedUrl: (file: File) => Promise<
|
|
136
|
+
getPresignedUrl: (file: File) => Promise<AWSPresignedUrlDTO>;
|
|
137
137
|
/**
|
|
138
138
|
* Called after the upload succeeds.
|
|
139
139
|
* You can use s3Url (the presigned URL you provided) in another component
|
|
140
140
|
* or have your backend process the file from S3.
|
|
141
141
|
*/
|
|
142
|
-
onUploadComplete?: (file: File, s3Url:
|
|
142
|
+
onUploadComplete?: (file: File, s3Url: AWSPresignedUrlDTO) => void;
|
|
143
143
|
/** Optional: restrict file types, e.g. "image/*" or ".png,.jpg" */
|
|
144
144
|
accept?: string;
|
|
145
145
|
/** Optional: label shown above the control */
|
package/dist/index.js
CHANGED
|
@@ -1046,7 +1046,7 @@ var SingleFileProcessUploader = ({ getPresignedUrl, onUploadComplete, accept, la
|
|
|
1046
1046
|
setProgress(0);
|
|
1047
1047
|
setErrorMessage(null);
|
|
1048
1048
|
const presignedUrl = await getPresignedUrl(selectedFile);
|
|
1049
|
-
await UploadFileToS3(selectedFile, presignedUrl, (p) => setProgress(p));
|
|
1049
|
+
await UploadFileToS3(selectedFile, presignedUrl?.PresignedUrl ?? "", (p) => setProgress(p));
|
|
1050
1050
|
setStatus("success");
|
|
1051
1051
|
onUploadComplete?.(selectedFile, presignedUrl);
|
|
1052
1052
|
} catch (err) {
|
|
@@ -1186,7 +1186,8 @@ function HomeContent() {
|
|
|
1186
1186
|
"https://localhost:5001"
|
|
1187
1187
|
);
|
|
1188
1188
|
const contentType = file.type || "application/octet-stream";
|
|
1189
|
-
|
|
1189
|
+
const result = await res.s3.GetTemporaryPreSignedUrl(new TemporaryFileDTO({ Name: file.name, ContentType: contentType }));
|
|
1190
|
+
return result;
|
|
1190
1191
|
}
|
|
1191
1192
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1192
1193
|
/* @__PURE__ */ jsx7(UserInfoCard, {}),
|