@zimbra/api-client 71.0.0 → 75.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 +76 -6
- package/dist/src/batch-client/index.d.ts +7 -4
- package/dist/src/batch-client/types.d.ts +6 -0
- package/dist/src/normalize/entities.d.ts +1 -0
- package/dist/src/request/types.d.ts +2 -0
- package/dist/src/schema/generated-schema-types.d.ts +82 -4
- package/dist/src/utils/normalize-otherAttribute-contact.d.ts +1 -1
- package/dist/zm-api-js-client.esm.js +267 -186
- 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 +136 -152
- package/package.json +8 -8
- package/src/apollo/zimbra-in-memory-cache.ts +6 -2
- package/src/batch-client/index.ts +48 -24
- package/src/batch-client/types.ts +7 -0
- package/src/normalize/entities.ts +42 -5
- package/src/request/types.ts +2 -0
- package/src/schema/generated-schema-types.ts +98 -4
- package/src/schema/schema.graphql +76 -6
- package/src/schema/schema.ts +10 -3
- package/src/utils/normalize-mime-parts.ts +10 -2
- package/src/utils/normalize-otherAttribute-contact.ts +23 -5
package/src/schema/schema.ts
CHANGED
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
PreferencesInput,
|
|
31
31
|
PropertiesInput,
|
|
32
32
|
RevokeRightsInput,
|
|
33
|
+
SaveSMimeCertInputUpload,
|
|
33
34
|
SearchFolderInput,
|
|
34
35
|
SendMessageInput,
|
|
35
36
|
ShareNotificationInput,
|
|
@@ -54,6 +55,7 @@ import {
|
|
|
54
55
|
ClientInfoInput,
|
|
55
56
|
CreateFolderOptions,
|
|
56
57
|
CreateSearchFolderOptions,
|
|
58
|
+
DiscoverRightOptions,
|
|
57
59
|
ExternalAccountDeleteInput,
|
|
58
60
|
ExternalAccountModifyInput,
|
|
59
61
|
FreeBusyOptions,
|
|
@@ -103,7 +105,7 @@ export function createZimbraSchema(options: ZimbraSchemaOptions): {
|
|
|
103
105
|
autoComplete: (_, variables) => client.autoComplete(variables as AutoCompleteOptions),
|
|
104
106
|
autoCompleteGAL: (_, variables) =>
|
|
105
107
|
client.autoCompleteGAL(variables as AutoCompleteGALOptions),
|
|
106
|
-
discoverRights: client.discoverRights,
|
|
108
|
+
discoverRights: (_, variables) => client.discoverRights(variables as DiscoverRightOptions),
|
|
107
109
|
downloadAttachment: (_, variables) => client.downloadAttachment(variables),
|
|
108
110
|
downloadDocument: (_, variables) => client.downloadDocument(variables),
|
|
109
111
|
downloadMessage: (_, variables, context = {}) => {
|
|
@@ -169,6 +171,7 @@ export function createZimbraSchema(options: ZimbraSchemaOptions): {
|
|
|
169
171
|
getSearchFolder: client.getSearchFolder,
|
|
170
172
|
getSMimePublicCerts: (_, variables) =>
|
|
171
173
|
client.getSMimePublicCerts(variables as GetSMimePublicCertsOptions),
|
|
174
|
+
getSMimeCertInfo: client.getSMimeCertInfo,
|
|
172
175
|
getTrustedDevices: client.getTrustedDevices,
|
|
173
176
|
getDeviceStatus: client.getDeviceStatus,
|
|
174
177
|
getWorkingHours: (_, variables) => client.getWorkingHours(variables as WorkingHoursOptions),
|
|
@@ -368,11 +371,15 @@ export function createZimbraSchema(options: ZimbraSchemaOptions): {
|
|
|
368
371
|
message as SendMessageInput,
|
|
369
372
|
accountName as string
|
|
370
373
|
),
|
|
371
|
-
sendMessage: (_, { message, accountName }, context = {}) =>
|
|
374
|
+
sendMessage: (_, { message, accountName, sign = false, encrypt = false }, context = {}) =>
|
|
372
375
|
(context.local ? localStoreClient : client).sendMessage(
|
|
373
376
|
message as SendMessageInput,
|
|
374
|
-
accountName as string
|
|
377
|
+
accountName as string,
|
|
378
|
+
sign as Boolean,
|
|
379
|
+
encrypt as Boolean
|
|
375
380
|
),
|
|
381
|
+
saveSMimeCert: (_, { upload, password }) =>
|
|
382
|
+
client.saveSMimeCert(upload as SaveSMimeCertInputUpload, password as string),
|
|
376
383
|
sendDeliveryReport: (_, { messageId }) => client.sendDeliveryReport(messageId),
|
|
377
384
|
uploadMessage: (_, { value }) => client.uploadMessage(value),
|
|
378
385
|
createTask: (_, { task }) => client.createTask(task as CalendarItemInput),
|
|
@@ -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
|
}
|
|
@@ -144,8 +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
|
|
148
|
-
part.contentType !== 'application/x-pkcs7-signature' &&
|
|
156
|
+
!ignoreContentTypeToShowAsAttachment.includes(part.contentType) &&
|
|
149
157
|
(acc[mode] || (acc[mode] = [])).push(processAttachment(part, mode));
|
|
150
158
|
|
|
151
159
|
if (isDesktop) {
|
|
@@ -20,8 +20,6 @@ const supportedContactAttributes = [
|
|
|
20
20
|
'workEmail2',
|
|
21
21
|
'homeEmail',
|
|
22
22
|
'homeEmail2',
|
|
23
|
-
'phone',
|
|
24
|
-
'phone2',
|
|
25
23
|
'companyPhone',
|
|
26
24
|
'companyPhone2',
|
|
27
25
|
'otherPhone',
|
|
@@ -65,6 +63,7 @@ const supportedContactAttributes = [
|
|
|
65
63
|
'website',
|
|
66
64
|
'notes',
|
|
67
65
|
'image',
|
|
66
|
+
'thumbnailPhoto',
|
|
68
67
|
'userCertificate',
|
|
69
68
|
'assistantPhone',
|
|
70
69
|
'callbackPhone',
|
|
@@ -79,7 +78,26 @@ const supportedContactAttributes = [
|
|
|
79
78
|
'fileAs',
|
|
80
79
|
'type'
|
|
81
80
|
];
|
|
82
|
-
|
|
81
|
+
|
|
82
|
+
const ignoreAttributes = [
|
|
83
|
+
'modifyTimeStamp',
|
|
84
|
+
'createTimeStamp',
|
|
85
|
+
'zimbraId',
|
|
86
|
+
'objectClass',
|
|
87
|
+
'zimbraMailForwardingAddress',
|
|
88
|
+
'zimbraAccountCalendarUserType',
|
|
89
|
+
'zimbraCalResLocationDisplayName',
|
|
90
|
+
'zimbraCalResType',
|
|
91
|
+
'cardOwner',
|
|
92
|
+
'homeCardMessage',
|
|
93
|
+
'homePhotoURL',
|
|
94
|
+
'workCardMessage',
|
|
95
|
+
'workPhotoURL',
|
|
96
|
+
'firstLast',
|
|
97
|
+
'vcardXProps',
|
|
98
|
+
'imagepart'
|
|
99
|
+
];
|
|
100
|
+
export function createContactBody(data: any, isDesktop: Boolean) {
|
|
83
101
|
const { attributes, ...rest } = data;
|
|
84
102
|
const contactAttrs = <Object[]>[];
|
|
85
103
|
|
|
@@ -87,7 +105,7 @@ export function createContactBody(data: any) {
|
|
|
87
105
|
key !== 'other'
|
|
88
106
|
? contactAttrs.push({
|
|
89
107
|
name: key,
|
|
90
|
-
[key === 'image' ? 'aid' : 'content']: val
|
|
108
|
+
[key === 'image' || (!isDesktop && key === 'userCertificate') ? 'aid' : 'content']: val
|
|
91
109
|
})
|
|
92
110
|
: forEach(val, otherValue =>
|
|
93
111
|
contactAttrs.push({
|
|
@@ -129,7 +147,7 @@ export function normalizeOtherAttr(data: any) {
|
|
|
129
147
|
}
|
|
130
148
|
|
|
131
149
|
Object.keys(contact._attrs)
|
|
132
|
-
.filter(key => !supportedContactAttributes.includes(key))
|
|
150
|
+
.filter(key => !supportedContactAttributes.includes(key) && !ignoreAttributes.includes(key))
|
|
133
151
|
.forEach(
|
|
134
152
|
key =>
|
|
135
153
|
typeof contact._attrs[key] === 'string' &&
|