@zimbra/api-client 86.1.0 → 87.1.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 +26 -1
- package/dist/src/schema/generated-schema-types.d.ts +24 -1
- package/dist/zm-api-js-client.esm.js +22 -4
- package/dist/zm-api-js-client.esm.js.map +1 -1
- package/dist/zm-api-js-client.js +6 -6
- package/dist/zm-api-js-client.js.map +1 -1
- package/dist/zm-api-js-client.umd.js +3 -3
- package/dist/zm-api-js-client.umd.js.map +1 -1
- package/package-lock.json +1 -1
- package/package.json +1 -1
- package/src/normalize/entities.ts +2 -2
- package/src/schema/generated-schema-types.ts +28 -1
- package/src/schema/schema.graphql +26 -1
- package/src/utils/normalize-mime-parts.ts +33 -0
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": "87.1.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",
|
|
@@ -131,7 +131,8 @@ const commonInviteFields = {
|
|
|
131
131
|
invId: 'inviteId',
|
|
132
132
|
loc: 'location',
|
|
133
133
|
or: ['organizer', CalendarItemOrganizer],
|
|
134
|
-
ridZ: 'utcRecurrenceId'
|
|
134
|
+
ridZ: 'utcRecurrenceId',
|
|
135
|
+
tzo: 'timezoneOffset'
|
|
135
136
|
};
|
|
136
137
|
|
|
137
138
|
const InviteComponent = new Entity({
|
|
@@ -368,7 +369,6 @@ export const CalendarItemHitInfo = new Entity({
|
|
|
368
369
|
recur: 'isRecurring',
|
|
369
370
|
ptst: 'participationStatus',
|
|
370
371
|
dur: 'duration',
|
|
371
|
-
tzo: 'timezoneOffset',
|
|
372
372
|
otherAtt: 'otherAttendees',
|
|
373
373
|
inst: ['instances', Instance],
|
|
374
374
|
inv: ['invitations', Invitation],
|
|
@@ -88,6 +88,7 @@ export type AccountInfoAttrs = {
|
|
|
88
88
|
zimbraExternalSharingEnabled?: Maybe<Scalars['Boolean']>;
|
|
89
89
|
zimbraFeatureAdminMailEnabled?: Maybe<Scalars['Boolean']>;
|
|
90
90
|
zimbraFeatureAdminPreferencesEnabled?: Maybe<Scalars['Boolean']>;
|
|
91
|
+
zimbraFeatureAllowUsernameInPassword?: Maybe<Scalars['Boolean']>;
|
|
91
92
|
zimbraFeatureAntispamEnabled?: Maybe<Scalars['Boolean']>;
|
|
92
93
|
zimbraFeatureAppSpecificPasswordsEnabled?: Maybe<Scalars['Boolean']>;
|
|
93
94
|
zimbraFeatureBriefcasesEnabled?: Maybe<Scalars['Boolean']>;
|
|
@@ -141,7 +142,6 @@ export type AccountInfoAttrs = {
|
|
|
141
142
|
zimbraMailSignatureMaxLength?: Maybe<Scalars['Float']>;
|
|
142
143
|
zimbraMailWhitelistMaxNumEntries?: Maybe<Scalars['Int']>;
|
|
143
144
|
zimbraMtaMaxMessageSize?: Maybe<Scalars['Float']>;
|
|
144
|
-
zimbraPasswordAllowUsername?: Maybe<Scalars['Boolean']>;
|
|
145
145
|
zimbraPasswordAllowedChars?: Maybe<Scalars['String']>;
|
|
146
146
|
zimbraPasswordAllowedPunctuationChars?: Maybe<Scalars['String']>;
|
|
147
147
|
zimbraPasswordBlockCommonEnabled?: Maybe<Scalars['Boolean']>;
|
|
@@ -337,6 +337,26 @@ export type AppointmentInfo = {
|
|
|
337
337
|
invitations?: Maybe<Array<Maybe<Invitation>>>;
|
|
338
338
|
};
|
|
339
339
|
|
|
340
|
+
export type AttachDoc = {
|
|
341
|
+
__typename?: 'AttachDoc';
|
|
342
|
+
doc?: Maybe<Array<Maybe<AttachDocs>>>;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
export type AttachDocInput = {
|
|
346
|
+
doc?: InputMaybe<Array<InputMaybe<AttachDocsInput>>>;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export type AttachDocs = {
|
|
350
|
+
__typename?: 'AttachDocs';
|
|
351
|
+
optional?: Maybe<Scalars['Int']>;
|
|
352
|
+
path?: Maybe<Scalars['String']>;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export type AttachDocsInput = {
|
|
356
|
+
optional?: InputMaybe<Scalars['Int']>;
|
|
357
|
+
path?: InputMaybe<Scalars['String']>;
|
|
358
|
+
};
|
|
359
|
+
|
|
340
360
|
export type Attachment = {
|
|
341
361
|
__typename?: 'Attachment';
|
|
342
362
|
content?: Maybe<Scalars['String']>;
|
|
@@ -345,6 +365,8 @@ export type Attachment = {
|
|
|
345
365
|
|
|
346
366
|
export type AttachmentInput = {
|
|
347
367
|
attachmentId?: InputMaybe<Scalars['String']>;
|
|
368
|
+
cd?: InputMaybe<Scalars['String']>;
|
|
369
|
+
ct?: InputMaybe<Scalars['String']>;
|
|
348
370
|
documents?: InputMaybe<Array<InputMaybe<DocumentInput>>>;
|
|
349
371
|
existingAttachments?: InputMaybe<Array<InputMaybe<ExistingAttachmentInput>>>;
|
|
350
372
|
messages?: InputMaybe<Array<InputMaybe<EmlInput>>>;
|
|
@@ -1317,6 +1339,8 @@ export type DocumentActionData = {
|
|
|
1317
1339
|
|
|
1318
1340
|
export type DocumentInput = {
|
|
1319
1341
|
id?: InputMaybe<Scalars['ID']>;
|
|
1342
|
+
optional?: InputMaybe<Scalars['Int']>;
|
|
1343
|
+
path?: InputMaybe<Scalars['String']>;
|
|
1320
1344
|
};
|
|
1321
1345
|
|
|
1322
1346
|
export type DtTimeInfo = {
|
|
@@ -1979,6 +2003,7 @@ export type Instance = {
|
|
|
1979
2003
|
revision?: Maybe<Scalars['Float']>;
|
|
1980
2004
|
start?: Maybe<Scalars['Float']>;
|
|
1981
2005
|
status?: Maybe<InviteCompletionStatus>;
|
|
2006
|
+
timezoneOffset?: Maybe<Scalars['Int']>;
|
|
1982
2007
|
tzoDue?: Maybe<Scalars['Int']>;
|
|
1983
2008
|
utcRecurrenceId?: Maybe<Scalars['String']>;
|
|
1984
2009
|
};
|
|
@@ -2310,6 +2335,7 @@ export type MimeHeaderConditionInput = {
|
|
|
2310
2335
|
|
|
2311
2336
|
export type MimePart = {
|
|
2312
2337
|
__typename?: 'MimePart';
|
|
2338
|
+
attach?: Maybe<AttachDoc>;
|
|
2313
2339
|
base64?: Maybe<Scalars['String']>;
|
|
2314
2340
|
body?: Maybe<Scalars['Boolean']>;
|
|
2315
2341
|
content?: Maybe<Scalars['String']>;
|
|
@@ -2327,6 +2353,7 @@ export type MimePart = {
|
|
|
2327
2353
|
};
|
|
2328
2354
|
|
|
2329
2355
|
export type MimePartInput = {
|
|
2356
|
+
attach?: InputMaybe<AttachDocInput>;
|
|
2330
2357
|
attachments?: InputMaybe<Array<InputMaybe<AttachmentInput>>>;
|
|
2331
2358
|
base64?: InputMaybe<Scalars['String']>;
|
|
2332
2359
|
body?: InputMaybe<Scalars['Boolean']>;
|
|
@@ -410,6 +410,7 @@ type Instance {
|
|
|
410
410
|
status: InviteCompletionStatus
|
|
411
411
|
isOrganizer: Boolean # isOrg
|
|
412
412
|
exceptId: [DtTimeInfo]
|
|
413
|
+
timezoneOffset: Int
|
|
413
414
|
}
|
|
414
415
|
|
|
415
416
|
type Alarm {
|
|
@@ -1332,7 +1333,7 @@ type AccountInfoAttrs {
|
|
|
1332
1333
|
zimbraFeatureMailForwardingEnabled: Boolean
|
|
1333
1334
|
zimbraFeatureMailForwardingInFiltersEnabled: Boolean
|
|
1334
1335
|
zimbraFeatureRetentionPolicyEnabled: Boolean
|
|
1335
|
-
|
|
1336
|
+
zimbraFeatureAllowUsernameInPassword: Boolean
|
|
1336
1337
|
zimbraPasswordBlockCommonEnabled: Boolean
|
|
1337
1338
|
zimbraPasswordMinAlphaChars: Int
|
|
1338
1339
|
zimbraPasswordMinNumericChars: Int
|
|
@@ -2021,6 +2022,25 @@ type MimePart {
|
|
|
2021
2022
|
messageId: ID
|
|
2022
2023
|
base64: String
|
|
2023
2024
|
truncated: Boolean
|
|
2025
|
+
attach: AttachDoc
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
type AttachDoc {
|
|
2029
|
+
doc: [AttachDocs]
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
type AttachDocs {
|
|
2033
|
+
path: String
|
|
2034
|
+
optional: Int
|
|
2035
|
+
}
|
|
2036
|
+
|
|
2037
|
+
input AttachDocInput {
|
|
2038
|
+
doc: [AttachDocsInput]
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
input AttachDocsInput {
|
|
2042
|
+
path: String
|
|
2043
|
+
optional: Int
|
|
2024
2044
|
}
|
|
2025
2045
|
|
|
2026
2046
|
type ActionData {
|
|
@@ -2049,6 +2069,7 @@ input MimePartInput {
|
|
|
2049
2069
|
attachments: [AttachmentInput]
|
|
2050
2070
|
base64: String,
|
|
2051
2071
|
truncated: Boolean
|
|
2072
|
+
attach: AttachDocInput
|
|
2052
2073
|
}
|
|
2053
2074
|
|
|
2054
2075
|
input ExistingAttachmentInput {
|
|
@@ -2058,6 +2079,8 @@ input ExistingAttachmentInput {
|
|
|
2058
2079
|
|
|
2059
2080
|
input DocumentInput {
|
|
2060
2081
|
id: ID
|
|
2082
|
+
path: String
|
|
2083
|
+
optional: Int
|
|
2061
2084
|
}
|
|
2062
2085
|
|
|
2063
2086
|
input EMLInput {
|
|
@@ -2069,6 +2092,8 @@ input AttachmentInput {
|
|
|
2069
2092
|
documents: [DocumentInput]
|
|
2070
2093
|
messages: [EMLInput]
|
|
2071
2094
|
existingAttachments: [ExistingAttachmentInput]
|
|
2095
|
+
ct: String
|
|
2096
|
+
cd: String
|
|
2072
2097
|
}
|
|
2073
2098
|
|
|
2074
2099
|
type AutoCompleteResponse {
|
|
@@ -104,11 +104,44 @@ export function normalizeMimeParts(
|
|
|
104
104
|
let isBody = false,
|
|
105
105
|
type = normalizeType(part.contentType),
|
|
106
106
|
disposition = normalizeDisposition(part.contentDisposition),
|
|
107
|
+
parts = part.mimeParts,
|
|
107
108
|
content = part.content || ''; //getPartContent(part);
|
|
108
109
|
|
|
109
110
|
// obey scapi's isBody flag:
|
|
110
111
|
if (isBody) acc.body = content;
|
|
111
112
|
|
|
113
|
+
// for a part of type /image, if its contentId matches with src of an <img /> in text/html part,
|
|
114
|
+
// change its contentDisposition to "inline"
|
|
115
|
+
if (type === 'multipart/related') {
|
|
116
|
+
let htmlPart: any;
|
|
117
|
+
|
|
118
|
+
parts.forEach((subpart: any) => {
|
|
119
|
+
// first set the html
|
|
120
|
+
if (subpart.contentType === 'text/html') {
|
|
121
|
+
htmlPart = subpart;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// then look for related image parts
|
|
126
|
+
if (
|
|
127
|
+
~subpart.contentType.indexOf('image/') &&
|
|
128
|
+
subpart.contentDisposition === 'attachment' &&
|
|
129
|
+
subpart.contentId &&
|
|
130
|
+
htmlPart.content
|
|
131
|
+
) {
|
|
132
|
+
// remove angle brackets from <contentId>
|
|
133
|
+
const contentId = subpart.contentId.slice(1, -1);
|
|
134
|
+
const bodyDom = new DOMParser().parseFromString(htmlPart.content, 'text/html');
|
|
135
|
+
const images = bodyDom?.querySelectorAll(`img[src="cid:${contentId}"]`) || [];
|
|
136
|
+
|
|
137
|
+
// change disposition to inline
|
|
138
|
+
if (images.length > 0) {
|
|
139
|
+
subpart.contentDisposition = 'inline';
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
|
|
112
145
|
const isInline = disposition === 'inline';
|
|
113
146
|
|
|
114
147
|
// if not explicitly an attachment, discover html/text body:
|