@zimbra/api-client 76.0.0 → 78.0.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.
@@ -485,6 +485,7 @@ interface MailItem {
485
485
  type ClientInfoAttributes {
486
486
  zimbraWebClientLoginURL: String
487
487
  zimbraWebClientLogoutURL: String
488
+ zimbraWebClientSkipLogoff: Boolean
488
489
  zimbraFeatureResetPasswordStatus: ResetPasswordStatus
489
490
  }
490
491
 
@@ -1657,6 +1658,7 @@ type OtherContactAttribute {
1657
1658
  type ContactAttributes {
1658
1659
  firstName: String
1659
1660
  phoneticFirstName: String
1661
+ phoneticCompany: String
1660
1662
  middleName: String
1661
1663
  lastName: String
1662
1664
  phoneticLastName: String
@@ -1761,6 +1763,7 @@ input OtherContactAttributeInput {
1761
1763
  input ContactAttrsInput {
1762
1764
  firstName: String
1763
1765
  phoneticFirstName: String
1766
+ phoneticCompany: String
1764
1767
  middleName: String
1765
1768
  lastName: String
1766
1769
  phoneticLastName: String
@@ -2836,6 +2839,7 @@ input EnableTwoFactorAuthInput {
2836
2839
  twoFactorCode: String
2837
2840
  authToken: String
2838
2841
  csrfTokenSecured: Boolean!
2842
+ ignoreSameSite: Boolean
2839
2843
  }
2840
2844
 
2841
2845
  input ExternalAccountImportInput {
@@ -3459,6 +3463,7 @@ type Mutation {
3459
3463
  twoFactorCode: String
3460
3464
  deviceTrusted: Boolean
3461
3465
  csrfTokenSecured: Boolean!
3466
+ ignoreSameSite: Boolean
3462
3467
  ): AuthResponse
3463
3468
  enableTwoFactorAuth(
3464
3469
  options: EnableTwoFactorAuthInput!
@@ -7,6 +7,8 @@ const ignoreContentTypeToShowAsAttachment = [
7
7
  'xml/x-zimbra-share' // present in folder share message
8
8
  ];
9
9
 
10
+ const MORE_TEXT_TYPES = ['text/rfc822-headers'];
11
+
10
12
  function normalizeCid(cid: string) {
11
13
  return cid.replace(/[<>]/g, '');
12
14
  }
@@ -107,11 +109,11 @@ export function normalizeMimeParts(
107
109
  // obey scapi's isBody flag:
108
110
  if (isBody) acc.body = content;
109
111
 
112
+ const isInline = disposition === 'inline';
113
+
110
114
  // if not explicitly an attachment, discover html/text body:
111
115
  if (disposition !== 'attachment') {
112
- let bodyType = type === 'text/html' ? 'html' : type === 'text/plain' && 'text';
113
-
114
- if (~type.indexOf('image/') && disposition === 'inline' && !part.contentId) {
116
+ if (isInline && ~type.indexOf('image/') && !part.contentId) {
115
117
  /**
116
118
  * Different email clients work in different ways.
117
119
  * E.g. iOS email client doesn't put `contentId` for image inline attachments when there are other type (normal) of attachments as well in email body.
@@ -129,29 +131,24 @@ export function normalizeMimeParts(
129
131
  );
130
132
 
131
133
  acc['html'] = acc['text']; // And then update `html` part so that we render `html` in `viewer`.
132
- } else if (
133
- //bodyType can be either 'text/html' or 'text/plain' so to handle such inline attachments the below condition is added
134
- part.filename &&
135
- bodyType &&
136
- disposition === 'inline'
137
- ) {
138
- (acc['inlineAttachments'] || (acc['inlineAttachments'] = [])).concat(
139
- processAttachment(part)
140
- );
141
- } else if (bodyType && (!acc[bodyType] || disposition !== 'inline')) {
142
- if ((bodyType === 'html' || bodyType === 'text') && acc[bodyType]) {
143
- acc[bodyType] = acc[bodyType].concat(content);
144
- } else {
145
- acc[bodyType] = content;
134
+ } else {
135
+ const isTextType = MORE_TEXT_TYPES.includes(type);
136
+ let bodyType =
137
+ type === 'text/html' ? 'html' : (type === 'text/plain' || isTextType) && 'text';
138
+
139
+ if (bodyType) {
140
+ //bodyType can be either 'text/html' or 'text/plain' so to handle such inline attachments the below condition is added
141
+ if (!(part.filename && isTextType && isInline)) {
142
+ isBody = true;
143
+ }
144
+ acc[bodyType] = (acc[bodyType] || '').concat(content);
146
145
  }
147
-
148
- isBody = true;
149
146
  }
150
147
  }
151
148
 
152
149
  // remaining non-body, non-enclosure parts are attachments:
153
150
  if (!isBody && type.split('/')[0] !== 'multipart') {
154
- let mode = disposition === 'inline' ? 'inlineAttachments' : 'attachments';
151
+ let mode = isInline ? 'inlineAttachments' : 'attachments';
155
152
 
156
153
  !ignoreContentTypeToShowAsAttachment.includes(part.contentType) &&
157
154
  (acc[mode] || (acc[mode] = [])).push(processAttachment(part, mode));
@@ -7,6 +7,7 @@ import { ContactInputRequest } from '../normalize/entities';
7
7
  const supportedContactAttributes = [
8
8
  'firstName',
9
9
  'phoneticFirstName',
10
+ 'phoneticCompany',
10
11
  'middleName',
11
12
  'lastName',
12
13
  'phoneticLastName',