@zimbra/api-client 76.0.0 → 77.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/.tmp/introspected-schema.json +31072 -0
- package/dist/schema.graphql +4 -0
- package/dist/src/batch-client/index.d.ts +2 -2
- package/dist/src/batch-client/types.d.ts +1 -0
- package/dist/src/schema/generated-schema-types.d.ts +4 -0
- package/dist/zm-api-js-client.esm.js +28 -21
- 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/batch-client/index.ts +6 -2
- package/src/batch-client/types.ts +1 -0
- package/src/schema/generated-schema-types.ts +4 -0
- package/src/schema/schema.graphql +4 -0
- package/src/utils/normalize-mime-parts.ts +17 -20
- package/src/utils/normalize-otherAttribute-contact.ts +1 -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": "77.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",
|
|
@@ -819,7 +819,8 @@ export class ZimbraBatchClient {
|
|
|
819
819
|
password,
|
|
820
820
|
authToken,
|
|
821
821
|
twoFactorCode,
|
|
822
|
-
csrfTokenSecured
|
|
822
|
+
csrfTokenSecured,
|
|
823
|
+
ignoreSameSite
|
|
823
824
|
}: EnableTwoFactorAuthInput) =>
|
|
824
825
|
this.jsonRequest({
|
|
825
826
|
name: 'EnableTwoFactorAuth',
|
|
@@ -842,6 +843,7 @@ export class ZimbraBatchClient {
|
|
|
842
843
|
_content: twoFactorCode
|
|
843
844
|
}
|
|
844
845
|
}),
|
|
846
|
+
...(ignoreSameSite && { ignoreSameSite }),
|
|
845
847
|
csrfTokenSecured
|
|
846
848
|
},
|
|
847
849
|
namespace: Namespace.Account,
|
|
@@ -1324,7 +1326,8 @@ export class ZimbraBatchClient {
|
|
|
1324
1326
|
persistAuthTokenCookie,
|
|
1325
1327
|
twoFactorCode,
|
|
1326
1328
|
deviceTrusted,
|
|
1327
|
-
csrfTokenSecured
|
|
1329
|
+
csrfTokenSecured,
|
|
1330
|
+
ignoreSameSite
|
|
1328
1331
|
}: LoginOptions) =>
|
|
1329
1332
|
this.jsonRequest({
|
|
1330
1333
|
name: 'Auth',
|
|
@@ -1337,6 +1340,7 @@ export class ZimbraBatchClient {
|
|
|
1337
1340
|
by: 'name',
|
|
1338
1341
|
_content: username
|
|
1339
1342
|
},
|
|
1343
|
+
...(ignoreSameSite && { ignoreSameSite }),
|
|
1340
1344
|
...(password && { password }),
|
|
1341
1345
|
...(recoveryCode && {
|
|
1342
1346
|
recoveryCode: {
|
|
@@ -244,6 +244,7 @@ export interface ModifyProfileImageOptions {
|
|
|
244
244
|
export interface LoginOptions {
|
|
245
245
|
csrfTokenSecured: boolean;
|
|
246
246
|
deviceTrusted?: boolean;
|
|
247
|
+
ignoreSameSite?: boolean;
|
|
247
248
|
password: string;
|
|
248
249
|
persistAuthTokenCookie?: boolean;
|
|
249
250
|
recoveryCode?: string;
|
|
@@ -889,6 +889,7 @@ export type ContactAttributes = {
|
|
|
889
889
|
otherURL?: Maybe<Scalars['String']>;
|
|
890
890
|
pager?: Maybe<Scalars['String']>;
|
|
891
891
|
pager2?: Maybe<Scalars['String']>;
|
|
892
|
+
phoneticCompany?: Maybe<Scalars['String']>;
|
|
892
893
|
phoneticFirstName?: Maybe<Scalars['String']>;
|
|
893
894
|
phoneticLastName?: Maybe<Scalars['String']>;
|
|
894
895
|
thumbnailPhoto?: Maybe<Scalars['String']>;
|
|
@@ -966,6 +967,7 @@ export type ContactAttrsInput = {
|
|
|
966
967
|
otherURL?: Maybe<Scalars['String']>;
|
|
967
968
|
pager?: Maybe<Scalars['String']>;
|
|
968
969
|
pager2?: Maybe<Scalars['String']>;
|
|
970
|
+
phoneticCompany?: Maybe<Scalars['String']>;
|
|
969
971
|
phoneticFirstName?: Maybe<Scalars['String']>;
|
|
970
972
|
phoneticLastName?: Maybe<Scalars['String']>;
|
|
971
973
|
type?: Maybe<Scalars['String']>;
|
|
@@ -1324,6 +1326,7 @@ export type EmailAddressInput = {
|
|
|
1324
1326
|
export type EnableTwoFactorAuthInput = {
|
|
1325
1327
|
authToken?: Maybe<Scalars['String']>;
|
|
1326
1328
|
csrfTokenSecured: Scalars['Boolean'];
|
|
1329
|
+
ignoreSameSite?: Maybe<Scalars['Boolean']>;
|
|
1327
1330
|
name: Scalars['String'];
|
|
1328
1331
|
password?: Maybe<Scalars['String']>;
|
|
1329
1332
|
twoFactorCode?: Maybe<Scalars['String']>;
|
|
@@ -2747,6 +2750,7 @@ export type MutationItemActionArgs = {
|
|
|
2747
2750
|
export type MutationLoginArgs = {
|
|
2748
2751
|
csrfTokenSecured: Scalars['Boolean'];
|
|
2749
2752
|
deviceTrusted?: Maybe<Scalars['Boolean']>;
|
|
2753
|
+
ignoreSameSite?: Maybe<Scalars['Boolean']>;
|
|
2750
2754
|
password?: Maybe<Scalars['String']>;
|
|
2751
2755
|
persistAuthTokenCookie?: Maybe<Scalars['Boolean']>;
|
|
2752
2756
|
recoveryCode?: Maybe<Scalars['String']>;
|
|
@@ -1657,6 +1657,7 @@ type OtherContactAttribute {
|
|
|
1657
1657
|
type ContactAttributes {
|
|
1658
1658
|
firstName: String
|
|
1659
1659
|
phoneticFirstName: String
|
|
1660
|
+
phoneticCompany: String
|
|
1660
1661
|
middleName: String
|
|
1661
1662
|
lastName: String
|
|
1662
1663
|
phoneticLastName: String
|
|
@@ -1761,6 +1762,7 @@ input OtherContactAttributeInput {
|
|
|
1761
1762
|
input ContactAttrsInput {
|
|
1762
1763
|
firstName: String
|
|
1763
1764
|
phoneticFirstName: String
|
|
1765
|
+
phoneticCompany: String
|
|
1764
1766
|
middleName: String
|
|
1765
1767
|
lastName: String
|
|
1766
1768
|
phoneticLastName: String
|
|
@@ -2836,6 +2838,7 @@ input EnableTwoFactorAuthInput {
|
|
|
2836
2838
|
twoFactorCode: String
|
|
2837
2839
|
authToken: String
|
|
2838
2840
|
csrfTokenSecured: Boolean!
|
|
2841
|
+
ignoreSameSite: Boolean
|
|
2839
2842
|
}
|
|
2840
2843
|
|
|
2841
2844
|
input ExternalAccountImportInput {
|
|
@@ -3459,6 +3462,7 @@ type Mutation {
|
|
|
3459
3462
|
twoFactorCode: String
|
|
3460
3463
|
deviceTrusted: Boolean
|
|
3461
3464
|
csrfTokenSecured: Boolean!
|
|
3465
|
+
ignoreSameSite: Boolean
|
|
3462
3466
|
): AuthResponse
|
|
3463
3467
|
enableTwoFactorAuth(
|
|
3464
3468
|
options: EnableTwoFactorAuthInput!
|
|
@@ -7,6 +7,8 @@ const ignoreContentTypeToShowAsAttachment = [
|
|
|
7
7
|
'xml/x-zimbra-share' // present in folder share message
|
|
8
8
|
];
|
|
9
9
|
|
|
10
|
+
const MORE_TEXT_TYPES = ['text/rfc822-headers'];
|
|
11
|
+
|
|
10
12
|
function normalizeCid(cid: string) {
|
|
11
13
|
return cid.replace(/[<>]/g, '');
|
|
12
14
|
}
|
|
@@ -107,11 +109,11 @@ export function normalizeMimeParts(
|
|
|
107
109
|
// obey scapi's isBody flag:
|
|
108
110
|
if (isBody) acc.body = content;
|
|
109
111
|
|
|
112
|
+
const isInline = disposition === 'inline';
|
|
113
|
+
|
|
110
114
|
// if not explicitly an attachment, discover html/text body:
|
|
111
115
|
if (disposition !== 'attachment') {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (~type.indexOf('image/') && disposition === 'inline' && !part.contentId) {
|
|
116
|
+
if (isInline && ~type.indexOf('image/') && !part.contentId) {
|
|
115
117
|
/**
|
|
116
118
|
* Different email clients work in different ways.
|
|
117
119
|
* E.g. iOS email client doesn't put `contentId` for image inline attachments when there are other type (normal) of attachments as well in email body.
|
|
@@ -129,29 +131,24 @@ export function normalizeMimeParts(
|
|
|
129
131
|
);
|
|
130
132
|
|
|
131
133
|
acc['html'] = acc['text']; // And then update `html` part so that we render `html` in `viewer`.
|
|
132
|
-
} else
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
acc[bodyType] = acc[bodyType].concat(content);
|
|
144
|
-
} else {
|
|
145
|
-
acc[bodyType] = content;
|
|
134
|
+
} else {
|
|
135
|
+
const isTextType = MORE_TEXT_TYPES.includes(type);
|
|
136
|
+
let bodyType =
|
|
137
|
+
type === 'text/html' ? 'html' : (type === 'text/plain' || isTextType) && 'text';
|
|
138
|
+
|
|
139
|
+
if (bodyType) {
|
|
140
|
+
//bodyType can be either 'text/html' or 'text/plain' so to handle such inline attachments the below condition is added
|
|
141
|
+
if (!(part.filename && isTextType && isInline)) {
|
|
142
|
+
isBody = true;
|
|
143
|
+
}
|
|
144
|
+
acc[bodyType] = (acc[bodyType] || '').concat(content);
|
|
146
145
|
}
|
|
147
|
-
|
|
148
|
-
isBody = true;
|
|
149
146
|
}
|
|
150
147
|
}
|
|
151
148
|
|
|
152
149
|
// remaining non-body, non-enclosure parts are attachments:
|
|
153
150
|
if (!isBody && type.split('/')[0] !== 'multipart') {
|
|
154
|
-
let mode =
|
|
151
|
+
let mode = isInline ? 'inlineAttachments' : 'attachments';
|
|
155
152
|
|
|
156
153
|
!ignoreContentTypeToShowAsAttachment.includes(part.contentType) &&
|
|
157
154
|
(acc[mode] || (acc[mode] = [])).push(processAttachment(part, mode));
|