@zimbra/api-client 95.0.0 → 96.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.
package/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zimbra/api-client",
3
- "version": "95.0.0",
3
+ "version": "96.0.0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zimbra/api-client",
3
3
  "amdName": "zmApiJsClient",
4
- "version": "95.0.0",
4
+ "version": "96.0.0",
5
5
  "description": "Zimbra JS API Client and GraphQL client for making requests against the Zimbra SOAP API.",
6
6
  "main": "dist/zm-api-js-client.js",
7
7
  "source": "index.ts",
@@ -7,6 +7,7 @@ import {
7
7
  Owner,
8
8
  SearchType,
9
9
  SortBy,
10
+ Timezone,
10
11
  UploadDocument
11
12
  } from '../schema/generated-schema-types';
12
13
 
@@ -204,6 +205,7 @@ export interface SearchOptions {
204
205
  sortBy?: SortBy;
205
206
  type?: GalSearchType;
206
207
  types?: SearchType;
208
+ tz?: Timezone;
207
209
  }
208
210
 
209
211
  export interface SearchCalendarResourcesCondition {
@@ -145,9 +145,11 @@ export type AccountInfoAttrs = {
145
145
  zimbraIdentityMaxNumEntries?: Maybe<Scalars['Int']['output']>;
146
146
  zimbraIsAdminAccount?: Maybe<Scalars['Boolean']['output']>;
147
147
  zimbraIsDelegatedAdminAccount?: Maybe<Scalars['Boolean']['output']>;
148
+ zimbraIsExternalVirtualAccount?: Maybe<Scalars['Boolean']['output']>;
148
149
  zimbraMailAlias?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
149
150
  zimbraMailAttachmentMaxSize?: Maybe<Scalars['Float']['output']>;
150
151
  zimbraMailBlacklistMaxNumEntries?: Maybe<Scalars['Int']['output']>;
152
+ zimbraMailIdleSessionTimeout?: Maybe<Scalars['String']['output']>;
151
153
  zimbraMailQuota?: Maybe<Scalars['String']['output']>;
152
154
  zimbraMailSignatureMaxLength?: Maybe<Scalars['Float']['output']>;
153
155
  zimbraMailWhitelistMaxNumEntries?: Maybe<Scalars['Int']['output']>;
@@ -3915,6 +3917,7 @@ export type QuerySearchArgs = {
3915
3917
  resultMode?: InputMaybe<Scalars['String']['input']>;
3916
3918
  sortBy?: InputMaybe<SortBy>;
3917
3919
  types?: InputMaybe<SearchType>;
3920
+ tz?: InputMaybe<Timezone>;
3918
3921
  };
3919
3922
 
3920
3923
 
@@ -4542,6 +4545,10 @@ export type Targets = {
4542
4545
  target?: Maybe<Array<Maybe<Target>>>;
4543
4546
  };
4544
4547
 
4548
+ export type Timezone = {
4549
+ id: Scalars['ID']['input'];
4550
+ };
4551
+
4545
4552
  export type TrustedDevicesEnabled = {
4546
4553
  __typename?: 'TrustedDevicesEnabled';
4547
4554
  _content?: Maybe<Scalars['Boolean']['output']>;
@@ -1460,6 +1460,7 @@ type AccountInfoAttrs {
1460
1460
  zimbraDumpsterEnabled: Boolean
1461
1461
  zimbraIsAdminAccount: Boolean
1462
1462
  zimbraIsDelegatedAdminAccount: Boolean
1463
+ zimbraIsExternalVirtualAccount: Boolean
1463
1464
  zimbraFeatureMailEnabled: Boolean
1464
1465
  zimbraFeatureCalendarEnabled: Boolean
1465
1466
  zimbraFeatureBriefcasesEnabled: Boolean
@@ -1545,6 +1546,7 @@ type AccountInfoAttrs {
1545
1546
  zimbraFeatureDistributionListFolderEnabled: Boolean
1546
1547
  zimbraFeatureBasicOneToOneChatEnabled: Boolean
1547
1548
  zimbraFeatureAdvancedChatEnabled: Boolean
1549
+ zimbraMailIdleSessionTimeout: String
1548
1550
  }
1549
1551
 
1550
1552
  type AccountCos {
@@ -3222,6 +3224,10 @@ input uploadDocument {
3222
3224
  id: ID! #id
3223
3225
  }
3224
3226
 
3227
+ input Timezone {
3228
+ id: ID! #id
3229
+ }
3230
+
3225
3231
  input messagePartForDocument {
3226
3232
  messageId: ID! #id
3227
3233
  attachmentPart: String! #part
@@ -3637,7 +3643,8 @@ type Query {
3637
3643
  types: SearchType
3638
3644
  resultMode: String
3639
3645
  inDumpster: Boolean,
3640
- header: [MailItemHeaderInput]
3646
+ header: [MailItemHeaderInput],
3647
+ tz: Timezone
3641
3648
  ): SearchResponse
3642
3649
 
3643
3650
  searchCalendarResources(
@@ -76,6 +76,9 @@ export function normalizeMimeParts(
76
76
  message: { [key: string]: any },
77
77
  { origin, jwtToken, isDesktop }: { isDesktop?: string; jwtToken?: string; origin?: string }
78
78
  ) {
79
+ let isMultipartWithInlineImage = false;
80
+ let iosMsgWithImage = '';
81
+
79
82
  const processAttachment = ({ ...attachment }, forcedContentDisposition?: string) => {
80
83
  attachment.messageId = attachment.messageId || message.id;
81
84
  attachment.url = getAttachmentUrl(attachment, { origin, jwtToken });
@@ -158,12 +161,11 @@ export function normalizeMimeParts(
158
161
 
159
162
  // Use `text` content, because iOS client always yield `text` part (no `html` part) when multiple attachments are present along with text content.
160
163
  // In cases of forwarded msg from iOS client, there wouldn't be `text` part, instead `html` parts.
161
- // Update `text` content so that we stay up-to-date on which CID placeholders were added.
162
- acc['text'] = (acc['text'] || acc['html'] || '').concat(
164
+ // To make sure to include inline image in html content store it in a variable and process later.
165
+ isMultipartWithInlineImage = true;
166
+ iosMsgWithImage = iosMsgWithImage.concat(
163
167
  `<br /><div><img src="cid:${attachment.contentId}" /></div><br />`
164
168
  );
165
-
166
- acc['html'] = acc['text']; // And then update `html` part so that we render `html` in `viewer`.
167
169
  } else {
168
170
  const isTextType = MORE_TEXT_TYPES.includes(type);
169
171
  let bodyType =
@@ -175,6 +177,7 @@ export function normalizeMimeParts(
175
177
  isBody = true;
176
178
  }
177
179
  acc[bodyType] = (acc[bodyType] || '').concat(content);
180
+ iosMsgWithImage = iosMsgWithImage.concat(content);
178
181
  }
179
182
  }
180
183
  }
@@ -203,6 +206,12 @@ export function normalizeMimeParts(
203
206
  // Default to null if not exist to unset the key if this is an update.
204
207
  message.autoSendTime = message.autoSendTime || null;
205
208
 
209
+ // For email sent from ios client or any other email client which may not provide html content and includes inline images,
210
+ // Convert the text part along with inline images into html so that it will be previewed as html content.
211
+ if (isMultipartWithInlineImage) {
212
+ message.html = iosMsgWithImage.replace(/\r\n/g, '<br />');
213
+ }
214
+
206
215
  // Some mail clients add contentId and contentLocation to attachment data even though it's not inline attachments
207
216
  // we are fixing it here
208
217
  // @TODO we should extend this to check if we have any placeholder in body for inline attachments then only consider it as inline attachment