@hiver/connector-agent 4.19.0-attachment-beta.1 → 4.19.0-attachment-beta.2
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/features/write-form/api/uploadAttachment.d.ts.map +1 -1
- package/index.es.js +11 -11
- package/index.umd.js +87 -87
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadAttachment.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/api/uploadAttachment.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;AAO1D,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IAGjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;
|
|
1
|
+
{"version":3,"file":"uploadAttachment.d.ts","sourceRoot":"","sources":["../../../../src/features/write-form/api/uploadAttachment.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,gBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;AAO1D,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IAGjB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAgED,eAAO,MAAM,gBAAgB,SAAgB,IAAI,eAAe,gBAAgB,KAAG,OAAO,CAAC,kBAAkB,CAgC5G,CAAC;AAKF,eAAO,MAAM,2BAA2B;UAEO,IAAI;iBAAe,gBAAgB;WAE9E,CAAC"}
|
package/index.es.js
CHANGED
|
@@ -22024,25 +22024,25 @@ const _k = w(J1)`
|
|
|
22024
22024
|
refetchOnMount: !1,
|
|
22025
22025
|
enabled: u
|
|
22026
22026
|
});
|
|
22027
|
-
}, Yk = (e, t, u) => new Promise((
|
|
22028
|
-
const
|
|
22029
|
-
|
|
22030
|
-
|
|
22031
|
-
}),
|
|
22032
|
-
if (
|
|
22033
|
-
|
|
22027
|
+
}, Yk = (e, t, u, n) => new Promise((r, o) => {
|
|
22028
|
+
const a = new XMLHttpRequest();
|
|
22029
|
+
a.open("PUT", e, !0), a.setRequestHeader("Content-Type", t.type || "application/octet-stream"), Object.entries(u ?? {}).forEach(([i, s]) => a.setRequestHeader(i, s)), a.upload && (a.upload.onprogress = (i) => {
|
|
22030
|
+
i.lengthComputable && (n == null || n(Math.round(i.loaded / i.total * 100)));
|
|
22031
|
+
}), a.onload = () => {
|
|
22032
|
+
if (a.status >= 200 && a.status < 300) {
|
|
22033
|
+
r();
|
|
22034
22034
|
return;
|
|
22035
22035
|
}
|
|
22036
|
-
|
|
22037
|
-
},
|
|
22036
|
+
o(Object.assign(new Error(`Upload failed (${a.status})`), { status: a.status }));
|
|
22037
|
+
}, a.onerror = () => o(new Error("upload network error")), a.onabort = () => o(new Error("upload aborted")), a.send(t);
|
|
22038
22038
|
}), qk = async (e, t) => {
|
|
22039
22039
|
try {
|
|
22040
22040
|
const u = await Te({
|
|
22041
22041
|
url: rI,
|
|
22042
22042
|
data: { filename: e.name, size: e.size },
|
|
22043
22043
|
method: je.POST
|
|
22044
|
-
}), { attachmentId: n, presignedUrl: r } = (u == null ? void 0 : u.data) ?? {};
|
|
22045
|
-
return await Yk(r, e, t), {
|
|
22044
|
+
}), { attachmentId: n, presignedUrl: r, headers: o } = (u == null ? void 0 : u.data) ?? {};
|
|
22045
|
+
return await Yk(r, e, o, t), {
|
|
22046
22046
|
attachmentId: n,
|
|
22047
22047
|
filename: e.name,
|
|
22048
22048
|
size: e.size,
|