@zimbra/api-client 69.0.0 → 73.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.
@@ -104,6 +104,7 @@ const CalendarItemOrganizer = new Entity({
104
104
 
105
105
  const commonFieldForMessageAndDocuments = {
106
106
  d: 'date',
107
+ sd: 'senderDate',
107
108
  f: 'flags',
108
109
  l: 'folderId',
109
110
  md: 'changeDate',
@@ -112,7 +113,8 @@ const commonFieldForMessageAndDocuments = {
112
113
  s: 'size',
113
114
  sf: 'sortField',
114
115
  t: 'tags',
115
- tn: 'tagNames'
116
+ tn: 'tagNames',
117
+ part: 'part'
116
118
  };
117
119
 
118
120
  const commonMessageFields = {
@@ -190,6 +192,7 @@ const ExistingAttachmentsInfo = new Entity({
190
192
  const AttachmentsInfo = new Entity({
191
193
  aid: 'attachmentId',
192
194
  doc: 'documents',
195
+ m: 'messages',
193
196
  mp: ['existingAttachments', ExistingAttachmentsInfo]
194
197
  });
195
198
 
@@ -95,6 +95,7 @@ export type AccountInfoAttrs = {
95
95
  zimbraFeatureIdentitiesEnabled?: Maybe<Scalars['Boolean']>;
96
96
  zimbraFeatureImapDataSourceEnabled?: Maybe<Scalars['Boolean']>;
97
97
  zimbraFeatureMailEnabled?: Maybe<Scalars['Boolean']>;
98
+ zimbraFeatureMailForwardingInFiltersEnabled?: Maybe<Scalars['Boolean']>;
98
99
  zimbraFeatureMailPriorityEnabled?: Maybe<Scalars['Boolean']>;
99
100
  zimbraFeatureMailSendLaterEnabled?: Maybe<Scalars['Boolean']>;
100
101
  zimbraFeatureManageZimlets?: Maybe<Scalars['Boolean']>;
@@ -329,6 +330,7 @@ export type AttachmentInput = {
329
330
  attachmentId?: Maybe<Scalars['String']>;
330
331
  documents?: Maybe<Array<Maybe<DocumentInput>>>;
331
332
  existingAttachments?: Maybe<Array<Maybe<ExistingAttachmentInput>>>;
333
+ messages?: Maybe<Array<Maybe<EmlInput>>>;
332
334
  };
333
335
 
334
336
  export type AuthResponse = {
@@ -1050,6 +1052,7 @@ export type Conversation = MailItem & {
1050
1052
  numMessages?: Maybe<Scalars['Float']>;
1051
1053
  replyType?: Maybe<Scalars['String']>;
1052
1054
  revision?: Maybe<Scalars['Float']>;
1055
+ senderDate?: Maybe<Scalars['Float']>;
1053
1056
  share?: Maybe<Array<Maybe<ShareNotification>>>;
1054
1057
  size?: Maybe<Scalars['Float']>;
1055
1058
  sortField?: Maybe<Scalars['String']>;
@@ -1297,6 +1300,10 @@ export type DtTimeInfo = {
1297
1300
  utc?: Maybe<Scalars['Float']>;
1298
1301
  };
1299
1302
 
1303
+ export type EmlInput = {
1304
+ id?: Maybe<Scalars['ID']>;
1305
+ };
1306
+
1300
1307
  export type EmailAddress = {
1301
1308
  __typename?: 'EmailAddress';
1302
1309
  address?: Maybe<Scalars['String']>;
@@ -2118,6 +2125,7 @@ export type MailItem = {
2118
2125
  modifiedSequence?: Maybe<Scalars['Float']>;
2119
2126
  replyType?: Maybe<Scalars['String']>;
2120
2127
  revision?: Maybe<Scalars['Float']>;
2128
+ senderDate?: Maybe<Scalars['Float']>;
2121
2129
  share?: Maybe<Array<Maybe<ShareNotification>>>;
2122
2130
  size?: Maybe<Scalars['Float']>;
2123
2131
  sortField?: Maybe<Scalars['String']>;
@@ -2230,9 +2238,12 @@ export type MessageInfo = MailItem & {
2230
2238
  mimeParts?: Maybe<Array<Maybe<MimePart>>>;
2231
2239
  modifiedSequence?: Maybe<Scalars['Float']>;
2232
2240
  origId?: Maybe<Scalars['ID']>;
2241
+ part?: Maybe<Scalars['String']>;
2242
+ replyTo?: Maybe<Array<Maybe<EmailAddress>>>;
2233
2243
  replyType?: Maybe<Scalars['String']>;
2234
2244
  revision?: Maybe<Scalars['Float']>;
2235
2245
  sender?: Maybe<Array<Maybe<EmailAddress>>>;
2246
+ senderDate?: Maybe<Scalars['Float']>;
2236
2247
  share?: Maybe<Array<Maybe<ShareNotification>>>;
2237
2248
  size?: Maybe<Scalars['Float']>;
2238
2249
  sortField?: Maybe<Scalars['String']>;
@@ -2347,6 +2358,7 @@ export type MsgWithGroupInfo = MailItem & {
2347
2358
  origid?: Maybe<Scalars['String']>;
2348
2359
  replyType?: Maybe<Scalars['String']>;
2349
2360
  revision?: Maybe<Scalars['Float']>;
2361
+ senderDate?: Maybe<Scalars['Float']>;
2350
2362
  share?: Maybe<Array<Maybe<ShareNotification>>>;
2351
2363
  size?: Maybe<Scalars['Float']>;
2352
2364
  sortField?: Maybe<Scalars['String']>;
@@ -3036,6 +3048,7 @@ export type Owner = {
3036
3048
  };
3037
3049
 
3038
3050
  export enum ParticipationRole {
3051
+ Cha = 'CHA',
3039
3052
  Non = 'NON',
3040
3053
  Opt = 'OPT',
3041
3054
  Req = 'REQ'
@@ -3686,6 +3699,7 @@ export type SMimeMessage = {
3686
3699
  __typename?: 'SMimeMessage';
3687
3700
  content?: Maybe<Scalars['String']>;
3688
3701
  id?: Maybe<Scalars['ID']>;
3702
+ isSecure?: Maybe<Scalars['Boolean']>;
3689
3703
  };
3690
3704
 
3691
3705
  export type SMimePublicCert = {
@@ -153,6 +153,7 @@ enum InviteCompletionStatus {
153
153
  enum ParticipationRole {
154
154
  REQ # required
155
155
  OPT # optional
156
+ CHA # chair
156
157
  NON # informational purposes only
157
158
  }
158
159
 
@@ -463,6 +464,7 @@ interface MailItem {
463
464
  id: ID
464
465
  size: Float # s
465
466
  date: Float # d
467
+ senderDate: Float #sd
466
468
  folderId: ID # l
467
469
  subject: String # su
468
470
  emailAddresses: [EmailAddress]
@@ -496,6 +498,7 @@ type MessageInfo implements MailItem {
496
498
  id: ID
497
499
  size: Float # s
498
500
  date: Float # d
501
+ senderDate: Float # sd
499
502
  folderId: ID # l
500
503
  origId: ID #origid
501
504
  subject: String # su
@@ -516,6 +519,7 @@ type MessageInfo implements MailItem {
516
519
  cc: [EmailAddress]
517
520
  bcc: [EmailAddress]
518
521
  sender: [EmailAddress]
522
+ replyTo: [EmailAddress]
519
523
  html: String
520
524
  text: String
521
525
  attachments: [MimePart]
@@ -525,12 +529,14 @@ type MessageInfo implements MailItem {
525
529
  attributes: MessageAttributes
526
530
  autoSendTime: Float
527
531
  local: Boolean
532
+ part: String
528
533
  }
529
534
 
530
535
  type Conversation implements MailItem {
531
536
  id: ID
532
537
  size: Float # s
533
538
  date: Float # d
539
+ senderDate: Float # sd
534
540
  folderId: ID # l
535
541
  subject: String # su
536
542
  excerpt: String # fr
@@ -562,6 +568,7 @@ type MsgWithGroupInfo implements MailItem {
562
568
  autoSendTime: Float
563
569
  size: Float # s
564
570
  date: Float # d
571
+ senderDate: Float # sd
565
572
  folderId: ID # l
566
573
  subject: String # su
567
574
  emailAddresses: [EmailAddress]
@@ -1297,6 +1304,7 @@ type AccountInfoAttrs {
1297
1304
  zimbraFeatureBriefcasesEnabled: Boolean
1298
1305
  zimbraFeatureMobileSyncEnabled: Boolean
1299
1306
  zimbraFeatureRelatedContactsEnabled: Boolean
1307
+ zimbraFeatureMailForwardingInFiltersEnabled: Boolean
1300
1308
  zimbraPasswordBlockCommonEnabled: Boolean
1301
1309
  zimbraPasswordMinAlphaChars: Int
1302
1310
  zimbraPasswordMinNumericChars: Int
@@ -2006,9 +2014,14 @@ input DocumentInput {
2006
2014
  id: ID
2007
2015
  }
2008
2016
 
2017
+ input EMLInput {
2018
+ id: ID
2019
+ }
2020
+
2009
2021
  input AttachmentInput {
2010
2022
  attachmentId: String
2011
2023
  documents: [DocumentInput]
2024
+ messages: [EMLInput]
2012
2025
  existingAttachments: [ExistingAttachmentInput]
2013
2026
  }
2014
2027
 
@@ -2978,6 +2991,7 @@ type SMimePublicCertsResponse {
2978
2991
  type SMimeMessage {
2979
2992
  id: ID
2980
2993
  content: String
2994
+ isSecure: Boolean
2981
2995
  }
2982
2996
 
2983
2997
  type Attachment {
@@ -3,7 +3,8 @@ enum Mapping {
3
3
  t = 'to',
4
4
  c = 'cc',
5
5
  b = 'bcc',
6
- s = 'sender'
6
+ s = 'sender',
7
+ r = 'replyTo'
7
8
  }
8
9
 
9
10
  export function parseAddress(address: string) {
@@ -1,3 +1,12 @@
1
+ /** List of content type not show as attachment */
2
+ const ignoreContentTypeToShowAsAttachment = [
3
+ 'application/pkcs7-signature',
4
+ 'application/x-pkcs7-signature',
5
+ 'message/delivery-status', // present in Undelivered mail
6
+ 'message/disposition-notification', // present in read-receipt response
7
+ 'xml/x-zimbra-share' // present in folder share message
8
+ ];
9
+
1
10
  function normalizeCid(cid: string) {
2
11
  return cid.replace(/[<>]/g, '');
3
12
  }
@@ -24,13 +33,13 @@ function reduceMimeParts(
24
33
  if (parts && parts.length) {
25
34
  for (let i = 0; i < parts.length; i++) {
26
35
  accumulator = iterator(parts[i], i, accumulator);
27
- reduceMimeParts(parts[i], iterator, accumulator);
36
+ if (parts[i].contentType !== 'message/rfc822')
37
+ reduceMimeParts(parts[i], iterator, accumulator);
28
38
  }
29
39
  }
30
40
 
31
41
  return accumulator;
32
42
  }
33
-
34
43
  export function getAttachmentUrl(
35
44
  attachment: { [key: string]: any },
36
45
  { origin = '', jwtToken }: { jwtToken?: string; origin?: string }
@@ -144,9 +153,7 @@ export function normalizeMimeParts(
144
153
  if (!isBody && type.split('/')[0] !== 'multipart') {
145
154
  let mode = disposition === 'inline' ? 'inlineAttachments' : 'attachments';
146
155
 
147
- part.contentType !== 'application/pkcs7-mime' &&
148
- part.contentType !== 'application/pkcs7-signature' &&
149
- part.contentType !== 'application/x-pkcs7-signature' &&
156
+ !ignoreContentTypeToShowAsAttachment.includes(part.contentType) &&
150
157
  (acc[mode] || (acc[mode] = [])).push(processAttachment(part, mode));
151
158
 
152
159
  if (isDesktop) {
@@ -65,6 +65,7 @@ const supportedContactAttributes = [
65
65
  'website',
66
66
  'notes',
67
67
  'image',
68
+ 'thumbnailPhoto',
68
69
  'userCertificate',
69
70
  'assistantPhone',
70
71
  'callbackPhone',
@@ -79,6 +80,25 @@ const supportedContactAttributes = [
79
80
  'fileAs',
80
81
  'type'
81
82
  ];
83
+
84
+ const ignoreAttributes = [
85
+ 'modifyTimeStamp',
86
+ 'createTimeStamp',
87
+ 'zimbraId',
88
+ 'objectClass',
89
+ 'zimbraMailForwardingAddress',
90
+ 'zimbraAccountCalendarUserType',
91
+ 'zimbraCalResLocationDisplayName',
92
+ 'zimbraCalResType',
93
+ 'cardOwner',
94
+ 'homeCardMessage',
95
+ 'homePhotoURL',
96
+ 'workCardMessage',
97
+ 'workPhotoURL',
98
+ 'firstLast',
99
+ 'vcardXProps',
100
+ 'imagepart'
101
+ ];
82
102
  export function createContactBody(data: any) {
83
103
  const { attributes, ...rest } = data;
84
104
  const contactAttrs = <Object[]>[];
@@ -129,7 +149,7 @@ export function normalizeOtherAttr(data: any) {
129
149
  }
130
150
 
131
151
  Object.keys(contact._attrs)
132
- .filter(key => !supportedContactAttributes.includes(key))
152
+ .filter(key => !supportedContactAttributes.includes(key) && !ignoreAttributes.includes(key))
133
153
  .forEach(
134
154
  key =>
135
155
  typeof contact._attrs[key] === 'string' &&