@zimbra/api-client 69.0.0 → 70.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/dist/schema.graphql +7 -0
- package/dist/src/batch-client/index.d.ts +1 -1
- package/dist/src/schema/generated-schema-types.d.ts +7 -0
- package/dist/zm-api-js-client.esm.js +37 -7
- package/dist/zm-api-js-client.esm.js.map +1 -1
- package/dist/zm-api-js-client.js +1 -1
- package/dist/zm-api-js-client.js.map +1 -1
- package/dist/zm-api-js-client.umd.js +1 -1
- package/dist/zm-api-js-client.umd.js.map +1 -1
- package/package-lock.json +1 -1
- package/package.json +1 -1
- package/src/apollo/zimbra-in-memory-cache.ts +5 -0
- package/src/batch-client/index.ts +17 -2
- package/src/normalize/entities.ts +3 -1
- package/src/schema/generated-schema-types.ts +7 -0
- package/src/schema/schema.graphql +7 -0
- package/src/utils/normalize-email-addresses.ts +2 -1
- package/src/utils/normalize-mime-parts.ts +3 -3
package/package-lock.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zimbra/api-client",
|
|
3
3
|
"amdName": "zmApiJsClient",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "70.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",
|
|
@@ -34,6 +34,11 @@ const dataIdFromObject = (object: any) => {
|
|
|
34
34
|
case 'ContactListMember':
|
|
35
35
|
// Contacts list members don't have ids
|
|
36
36
|
return `${object.type}:${object.value}`;
|
|
37
|
+
case 'MessageInfo':
|
|
38
|
+
if (object.part && object.part !== null) {
|
|
39
|
+
return `${defaultDataIdFromObject(object)}:${object.part}`;
|
|
40
|
+
}
|
|
41
|
+
return defaultDataIdFromObject(object);
|
|
37
42
|
default:
|
|
38
43
|
return defaultDataIdFromObject(object);
|
|
39
44
|
}
|
|
@@ -1027,6 +1027,20 @@ export class ZimbraBatchClient {
|
|
|
1027
1027
|
|
|
1028
1028
|
if (folders.folders) {
|
|
1029
1029
|
folders.folders = folders.folders.map(setUnreadDescendentFlag);
|
|
1030
|
+
|
|
1031
|
+
folders.folders = folders.folders.map((currentFolder: any) => {
|
|
1032
|
+
if (currentFolder.linkedFolders) {
|
|
1033
|
+
currentFolder.linkedFolders = currentFolder.linkedFolders.map((linkFolder: any) => {
|
|
1034
|
+
const { absFolderPath, oname, folders } = linkFolder;
|
|
1035
|
+
|
|
1036
|
+
if (oname && folders) {
|
|
1037
|
+
linkFolder.folders = updateAbsoluteFolderPath(oname, absFolderPath, folders);
|
|
1038
|
+
}
|
|
1039
|
+
return linkFolder;
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
return currentFolder;
|
|
1043
|
+
});
|
|
1030
1044
|
}
|
|
1031
1045
|
if (folders.linkedFolders) {
|
|
1032
1046
|
folders.linkedFolders = folders.linkedFolders.map(setUnreadDescendentFlag);
|
|
@@ -1129,7 +1143,7 @@ export class ZimbraBatchClient {
|
|
|
1129
1143
|
return mapValuesDeep(res, coerceStringToBoolean);
|
|
1130
1144
|
});
|
|
1131
1145
|
|
|
1132
|
-
public getMessage = ({ id, html, raw, header, read, max, ridZ }: GetMessageOptions) =>
|
|
1146
|
+
public getMessage = ({ id, html, raw, header, read, max, ridZ, part }: GetMessageOptions) =>
|
|
1133
1147
|
this.jsonRequest({
|
|
1134
1148
|
name: 'GetMsg',
|
|
1135
1149
|
body: {
|
|
@@ -1144,7 +1158,8 @@ export class ZimbraBatchClient {
|
|
|
1144
1158
|
// max body length (look for mp.truncated=1)
|
|
1145
1159
|
max: max || 250000,
|
|
1146
1160
|
raw: raw ? 1 : 0,
|
|
1147
|
-
...(ridZ && { ridZ: ridZ })
|
|
1161
|
+
...(ridZ && { ridZ: ridZ }),
|
|
1162
|
+
...(part && { part: part })
|
|
1148
1163
|
}
|
|
1149
1164
|
}
|
|
1150
1165
|
}).then(res => (res && res.m ? this.normalizeMessage(res.m[0]) : null));
|
|
@@ -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 = {
|
|
@@ -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']>;
|
|
@@ -1050,6 +1051,7 @@ export type Conversation = MailItem & {
|
|
|
1050
1051
|
numMessages?: Maybe<Scalars['Float']>;
|
|
1051
1052
|
replyType?: Maybe<Scalars['String']>;
|
|
1052
1053
|
revision?: Maybe<Scalars['Float']>;
|
|
1054
|
+
senderDate?: Maybe<Scalars['Float']>;
|
|
1053
1055
|
share?: Maybe<Array<Maybe<ShareNotification>>>;
|
|
1054
1056
|
size?: Maybe<Scalars['Float']>;
|
|
1055
1057
|
sortField?: Maybe<Scalars['String']>;
|
|
@@ -2118,6 +2120,7 @@ export type MailItem = {
|
|
|
2118
2120
|
modifiedSequence?: Maybe<Scalars['Float']>;
|
|
2119
2121
|
replyType?: Maybe<Scalars['String']>;
|
|
2120
2122
|
revision?: Maybe<Scalars['Float']>;
|
|
2123
|
+
senderDate?: Maybe<Scalars['Float']>;
|
|
2121
2124
|
share?: Maybe<Array<Maybe<ShareNotification>>>;
|
|
2122
2125
|
size?: Maybe<Scalars['Float']>;
|
|
2123
2126
|
sortField?: Maybe<Scalars['String']>;
|
|
@@ -2230,9 +2233,12 @@ export type MessageInfo = MailItem & {
|
|
|
2230
2233
|
mimeParts?: Maybe<Array<Maybe<MimePart>>>;
|
|
2231
2234
|
modifiedSequence?: Maybe<Scalars['Float']>;
|
|
2232
2235
|
origId?: Maybe<Scalars['ID']>;
|
|
2236
|
+
part?: Maybe<Scalars['String']>;
|
|
2237
|
+
replyTo?: Maybe<Array<Maybe<EmailAddress>>>;
|
|
2233
2238
|
replyType?: Maybe<Scalars['String']>;
|
|
2234
2239
|
revision?: Maybe<Scalars['Float']>;
|
|
2235
2240
|
sender?: Maybe<Array<Maybe<EmailAddress>>>;
|
|
2241
|
+
senderDate?: Maybe<Scalars['Float']>;
|
|
2236
2242
|
share?: Maybe<Array<Maybe<ShareNotification>>>;
|
|
2237
2243
|
size?: Maybe<Scalars['Float']>;
|
|
2238
2244
|
sortField?: Maybe<Scalars['String']>;
|
|
@@ -2347,6 +2353,7 @@ export type MsgWithGroupInfo = MailItem & {
|
|
|
2347
2353
|
origid?: Maybe<Scalars['String']>;
|
|
2348
2354
|
replyType?: Maybe<Scalars['String']>;
|
|
2349
2355
|
revision?: Maybe<Scalars['Float']>;
|
|
2356
|
+
senderDate?: Maybe<Scalars['Float']>;
|
|
2350
2357
|
share?: Maybe<Array<Maybe<ShareNotification>>>;
|
|
2351
2358
|
size?: Maybe<Scalars['Float']>;
|
|
2352
2359
|
sortField?: Maybe<Scalars['String']>;
|
|
@@ -463,6 +463,7 @@ interface MailItem {
|
|
|
463
463
|
id: ID
|
|
464
464
|
size: Float # s
|
|
465
465
|
date: Float # d
|
|
466
|
+
senderDate: Float #sd
|
|
466
467
|
folderId: ID # l
|
|
467
468
|
subject: String # su
|
|
468
469
|
emailAddresses: [EmailAddress]
|
|
@@ -496,6 +497,7 @@ type MessageInfo implements MailItem {
|
|
|
496
497
|
id: ID
|
|
497
498
|
size: Float # s
|
|
498
499
|
date: Float # d
|
|
500
|
+
senderDate: Float # sd
|
|
499
501
|
folderId: ID # l
|
|
500
502
|
origId: ID #origid
|
|
501
503
|
subject: String # su
|
|
@@ -516,6 +518,7 @@ type MessageInfo implements MailItem {
|
|
|
516
518
|
cc: [EmailAddress]
|
|
517
519
|
bcc: [EmailAddress]
|
|
518
520
|
sender: [EmailAddress]
|
|
521
|
+
replyTo: [EmailAddress]
|
|
519
522
|
html: String
|
|
520
523
|
text: String
|
|
521
524
|
attachments: [MimePart]
|
|
@@ -525,12 +528,14 @@ type MessageInfo implements MailItem {
|
|
|
525
528
|
attributes: MessageAttributes
|
|
526
529
|
autoSendTime: Float
|
|
527
530
|
local: Boolean
|
|
531
|
+
part: String
|
|
528
532
|
}
|
|
529
533
|
|
|
530
534
|
type Conversation implements MailItem {
|
|
531
535
|
id: ID
|
|
532
536
|
size: Float # s
|
|
533
537
|
date: Float # d
|
|
538
|
+
senderDate: Float # sd
|
|
534
539
|
folderId: ID # l
|
|
535
540
|
subject: String # su
|
|
536
541
|
excerpt: String # fr
|
|
@@ -562,6 +567,7 @@ type MsgWithGroupInfo implements MailItem {
|
|
|
562
567
|
autoSendTime: Float
|
|
563
568
|
size: Float # s
|
|
564
569
|
date: Float # d
|
|
570
|
+
senderDate: Float # sd
|
|
565
571
|
folderId: ID # l
|
|
566
572
|
subject: String # su
|
|
567
573
|
emailAddresses: [EmailAddress]
|
|
@@ -1297,6 +1303,7 @@ type AccountInfoAttrs {
|
|
|
1297
1303
|
zimbraFeatureBriefcasesEnabled: Boolean
|
|
1298
1304
|
zimbraFeatureMobileSyncEnabled: Boolean
|
|
1299
1305
|
zimbraFeatureRelatedContactsEnabled: Boolean
|
|
1306
|
+
zimbraFeatureMailForwardingInFiltersEnabled: Boolean
|
|
1300
1307
|
zimbraPasswordBlockCommonEnabled: Boolean
|
|
1301
1308
|
zimbraPasswordMinAlphaChars: Int
|
|
1302
1309
|
zimbraPasswordMinNumericChars: Int
|
|
@@ -24,13 +24,13 @@ function reduceMimeParts(
|
|
|
24
24
|
if (parts && parts.length) {
|
|
25
25
|
for (let i = 0; i < parts.length; i++) {
|
|
26
26
|
accumulator = iterator(parts[i], i, accumulator);
|
|
27
|
-
|
|
27
|
+
if (parts[i].contentType !== 'message/rfc822')
|
|
28
|
+
reduceMimeParts(parts[i], iterator, accumulator);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
return accumulator;
|
|
32
33
|
}
|
|
33
|
-
|
|
34
34
|
export function getAttachmentUrl(
|
|
35
35
|
attachment: { [key: string]: any },
|
|
36
36
|
{ origin = '', jwtToken }: { jwtToken?: string; origin?: string }
|
|
@@ -144,7 +144,7 @@ export function normalizeMimeParts(
|
|
|
144
144
|
if (!isBody && type.split('/')[0] !== 'multipart') {
|
|
145
145
|
let mode = disposition === 'inline' ? 'inlineAttachments' : 'attachments';
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
part.contentType !== 'application/pkcs7-signature' &&
|
|
149
149
|
part.contentType !== 'application/x-pkcs7-signature' &&
|
|
150
150
|
(acc[mode] || (acc[mode] = [])).push(processAttachment(part, mode));
|