@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 CHANGED
@@ -6018,9 +6018,18 @@ __export(secure_mail_exports, {
6018
6018
  prepareSecureMail: () => prepareSecureMail,
6019
6019
  secureMime: () => secureMime
6020
6020
  });
6021
+
6022
+ // src/operations/mail-encoding.ts
6023
+ function bytesToBase64(bytes) {
6024
+ let binary = "";
6025
+ for (let i2 = 0; i2 < bytes.length; i2 += 32768) {
6026
+ binary += String.fromCharCode(...bytes.subarray(i2, i2 + 32768));
6027
+ }
6028
+ return btoa(binary);
6029
+ }
6021
6030
  var MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
6022
6031
  var utf8 = new TextEncoder();
6023
- var encodedWord = (value) => `=?UTF-8?B?${client.bytesToBase64(utf8.encode(value))}?=`;
6032
+ var encodedWord = (value) => `=?UTF-8?B?${bytesToBase64(utf8.encode(value))}?=`;
6024
6033
  var folded = (value) => value.match(/.{1,76}/g)?.join("\r\n") ?? "";
6025
6034
  var safeHeader = (value) => {
6026
6035
  if (/[\r\n\0]/.test(value)) throw new Error("Email headers cannot contain newlines");
@@ -6046,7 +6055,7 @@ function secureMime(compose, sender) {
6046
6055
  const plainPart = `Content-Type: text/plain; charset="utf-8"\r
6047
6056
  Content-Transfer-Encoding: base64\r
6048
6057
  \r
6049
- ${folded(client.bytesToBase64(utf8.encode(compose.text)))}`;
6058
+ ${folded(bytesToBase64(utf8.encode(compose.text)))}`;
6050
6059
  const bodyPart = compose.html ? `Content-Type: multipart/alternative; boundary="${alternative}"\r
6051
6060
  \r
6052
6061
  --${alternative}\r
@@ -6055,7 +6064,7 @@ ${plainPart}\r
6055
6064
  Content-Type: text/html; charset="utf-8"\r
6056
6065
  Content-Transfer-Encoding: base64\r
6057
6066
  \r
6058
- ${folded(client.bytesToBase64(utf8.encode(compose.html)))}\r
6067
+ ${folded(bytesToBase64(utf8.encode(compose.html)))}\r
6059
6068
  --${alternative}--\r
6060
6069
  ` : plainPart;
6061
6070
  const parts = [
@@ -9883,16 +9892,9 @@ function attachmentFromBytes(name, contentType, bytes) {
9883
9892
  name,
9884
9893
  content_type: contentType,
9885
9894
  size: bytes.length,
9886
- content_base64: bytesToBase644(bytes)
9895
+ content_base64: bytesToBase64(bytes)
9887
9896
  };
9888
9897
  }
9889
- function bytesToBase644(bytes) {
9890
- let binary = "";
9891
- for (let i2 = 0; i2 < bytes.length; i2 += 32768) {
9892
- binary += String.fromCharCode(...bytes.subarray(i2, i2 + 32768));
9893
- }
9894
- return btoa(binary);
9895
- }
9896
9898
 
9897
9899
  // src/operations/calendar.ts
9898
9900
  var calendar_exports = {};