@arbidocs/sdk 0.5.70 → 0.5.71
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/browser.cjs +13 -11
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +18 -16
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +13 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/examples/react-chat/package.json +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -6583,9 +6583,18 @@ __export(secure_mail_exports, {
|
|
|
6583
6583
|
prepareSecureMail: () => prepareSecureMail,
|
|
6584
6584
|
secureMime: () => secureMime
|
|
6585
6585
|
});
|
|
6586
|
+
|
|
6587
|
+
// src/operations/mail-encoding.ts
|
|
6588
|
+
function bytesToBase64(bytes) {
|
|
6589
|
+
let binary = "";
|
|
6590
|
+
for (let i2 = 0; i2 < bytes.length; i2 += 32768) {
|
|
6591
|
+
binary += String.fromCharCode(...bytes.subarray(i2, i2 + 32768));
|
|
6592
|
+
}
|
|
6593
|
+
return btoa(binary);
|
|
6594
|
+
}
|
|
6586
6595
|
var MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
|
|
6587
6596
|
var utf8 = new TextEncoder();
|
|
6588
|
-
var encodedWord = (value) => `=?UTF-8?B?${
|
|
6597
|
+
var encodedWord = (value) => `=?UTF-8?B?${bytesToBase64(utf8.encode(value))}?=`;
|
|
6589
6598
|
var folded = (value) => value.match(/.{1,76}/g)?.join("\r\n") ?? "";
|
|
6590
6599
|
var safeHeader = (value) => {
|
|
6591
6600
|
if (/[\r\n\0]/.test(value)) throw new Error("Email headers cannot contain newlines");
|
|
@@ -6611,7 +6620,7 @@ function secureMime(compose, sender) {
|
|
|
6611
6620
|
const plainPart = `Content-Type: text/plain; charset="utf-8"\r
|
|
6612
6621
|
Content-Transfer-Encoding: base64\r
|
|
6613
6622
|
\r
|
|
6614
|
-
${folded(
|
|
6623
|
+
${folded(bytesToBase64(utf8.encode(compose.text)))}`;
|
|
6615
6624
|
const bodyPart = compose.html ? `Content-Type: multipart/alternative; boundary="${alternative}"\r
|
|
6616
6625
|
\r
|
|
6617
6626
|
--${alternative}\r
|
|
@@ -6620,7 +6629,7 @@ ${plainPart}\r
|
|
|
6620
6629
|
Content-Type: text/html; charset="utf-8"\r
|
|
6621
6630
|
Content-Transfer-Encoding: base64\r
|
|
6622
6631
|
\r
|
|
6623
|
-
${folded(
|
|
6632
|
+
${folded(bytesToBase64(utf8.encode(compose.html)))}\r
|
|
6624
6633
|
--${alternative}--\r
|
|
6625
6634
|
` : plainPart;
|
|
6626
6635
|
const parts = [
|
|
@@ -10469,16 +10478,9 @@ function attachmentFromBytes(name, contentType, bytes) {
|
|
|
10469
10478
|
name,
|
|
10470
10479
|
content_type: contentType,
|
|
10471
10480
|
size: bytes.length,
|
|
10472
|
-
content_base64:
|
|
10481
|
+
content_base64: bytesToBase64(bytes)
|
|
10473
10482
|
};
|
|
10474
10483
|
}
|
|
10475
|
-
function bytesToBase644(bytes) {
|
|
10476
|
-
let binary = "";
|
|
10477
|
-
for (let i2 = 0; i2 < bytes.length; i2 += 32768) {
|
|
10478
|
-
binary += String.fromCharCode(...bytes.subarray(i2, i2 + 32768));
|
|
10479
|
-
}
|
|
10480
|
-
return btoa(binary);
|
|
10481
|
-
}
|
|
10482
10484
|
|
|
10483
10485
|
// src/operations/calendar.ts
|
|
10484
10486
|
var calendar_exports = {};
|