@zimbra/api-client 74.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/package-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zimbra/api-client",
3
- "version": "74.0.0",
3
+ "version": "77.0.0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zimbra/api-client",
3
3
  "amdName": "zmApiJsClient",
4
- "version": "74.0.0",
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;
@@ -83,6 +83,7 @@ export type AccountInfoAttrs = {
83
83
  zimbraDomainTrialExpirationDate?: Maybe<Scalars['String']>;
84
84
  zimbraDumpsterEnabled?: Maybe<Scalars['Boolean']>;
85
85
  zimbraExternalSharingEnabled?: Maybe<Scalars['Boolean']>;
86
+ zimbraFeatureAntispamEnabled?: Maybe<Scalars['Boolean']>;
86
87
  zimbraFeatureAppSpecificPasswordsEnabled?: Maybe<Scalars['Boolean']>;
87
88
  zimbraFeatureBriefcasesEnabled?: Maybe<Scalars['Boolean']>;
88
89
  zimbraFeatureCalendarEnabled?: Maybe<Scalars['Boolean']>;
@@ -108,6 +109,7 @@ export type AccountInfoAttrs = {
108
109
  zimbraFeatureResetPasswordStatus?: Maybe<ResetPasswordStatus>;
109
110
  zimbraFeatureSharingEnabled?: Maybe<Scalars['Boolean']>;
110
111
  zimbraFeatureTaggingEnabled?: Maybe<Scalars['Boolean']>;
112
+ zimbraFeatureTasksEnabled?: Maybe<Scalars['Boolean']>;
111
113
  zimbraFeatureTrustedDevicesEnabled?: Maybe<Scalars['Boolean']>;
112
114
  zimbraFeatureTwoFactorAuthAvailable?: Maybe<Scalars['Boolean']>;
113
115
  zimbraFeatureTwoFactorAuthRequired?: Maybe<Scalars['Boolean']>;
@@ -887,8 +889,7 @@ export type ContactAttributes = {
887
889
  otherURL?: Maybe<Scalars['String']>;
888
890
  pager?: Maybe<Scalars['String']>;
889
891
  pager2?: Maybe<Scalars['String']>;
890
- phone?: Maybe<Scalars['String']>;
891
- phone2?: 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,8 +967,7 @@ export type ContactAttrsInput = {
966
967
  otherURL?: Maybe<Scalars['String']>;
967
968
  pager?: Maybe<Scalars['String']>;
968
969
  pager2?: Maybe<Scalars['String']>;
969
- phone?: Maybe<Scalars['String']>;
970
- phone2?: Maybe<Scalars['String']>;
970
+ phoneticCompany?: Maybe<Scalars['String']>;
971
971
  phoneticFirstName?: Maybe<Scalars['String']>;
972
972
  phoneticLastName?: Maybe<Scalars['String']>;
973
973
  type?: Maybe<Scalars['String']>;
@@ -1129,7 +1129,7 @@ export type Cursor = {
1129
1129
  endSortVal?: Maybe<Scalars['String']>;
1130
1130
  id?: Maybe<Scalars['ID']>;
1131
1131
  includeOffset?: Maybe<Scalars['Boolean']>;
1132
- sortField?: Maybe<Scalars['String']>;
1132
+ sortVal?: Maybe<Scalars['String']>;
1133
1133
  };
1134
1134
 
1135
1135
  export type CustomMetadata = {
@@ -1326,6 +1326,7 @@ export type EmailAddressInput = {
1326
1326
  export type EnableTwoFactorAuthInput = {
1327
1327
  authToken?: Maybe<Scalars['String']>;
1328
1328
  csrfTokenSecured: Scalars['Boolean'];
1329
+ ignoreSameSite?: Maybe<Scalars['Boolean']>;
1329
1330
  name: Scalars['String'];
1330
1331
  password?: Maybe<Scalars['String']>;
1331
1332
  twoFactorCode?: Maybe<Scalars['String']>;
@@ -2749,6 +2750,7 @@ export type MutationItemActionArgs = {
2749
2750
  export type MutationLoginArgs = {
2750
2751
  csrfTokenSecured: Scalars['Boolean'];
2751
2752
  deviceTrusted?: Maybe<Scalars['Boolean']>;
2753
+ ignoreSameSite?: Maybe<Scalars['Boolean']>;
2752
2754
  password?: Maybe<Scalars['String']>;
2753
2755
  persistAuthTokenCookie?: Maybe<Scalars['Boolean']>;
2754
2756
  recoveryCode?: Maybe<Scalars['String']>;
@@ -1344,6 +1344,7 @@ type AccountInfoAttrs {
1344
1344
  zimbraFeatureDocumentEditingEnabled: Boolean
1345
1345
  zimbraTwoFactorAuthEnabled: Boolean
1346
1346
  zimbraFeatureTrustedDevicesEnabled: Boolean
1347
+ zimbraFeatureAntispamEnabled: Boolean
1347
1348
  zimbraFeatureAppSpecificPasswordsEnabled: Boolean
1348
1349
  zimbraFeatureMailPriorityEnabled: Boolean
1349
1350
  zimbraFileUploadMaxSize: Float
@@ -1361,6 +1362,7 @@ type AccountInfoAttrs {
1361
1362
  zimbraFeaturePop3DataSourceEnabled: Boolean
1362
1363
  zimbraSignupAffiliate: String
1363
1364
  zimbraSignupRecoveryEmail: String
1365
+ zimbraFeatureTasksEnabled: Boolean
1364
1366
  zimbraTrialExpirationDate: String
1365
1367
  zimbraTrialConvertAtExpiration: Boolean
1366
1368
  zimbraHierarchicalAddressBookRoot: String
@@ -1655,6 +1657,7 @@ type OtherContactAttribute {
1655
1657
  type ContactAttributes {
1656
1658
  firstName: String
1657
1659
  phoneticFirstName: String
1660
+ phoneticCompany: String
1658
1661
  middleName: String
1659
1662
  lastName: String
1660
1663
  phoneticLastName: String
@@ -1668,8 +1671,6 @@ type ContactAttributes {
1668
1671
  workEmail2: String
1669
1672
  homeEmail: String
1670
1673
  homeEmail2: String
1671
- phone: String
1672
- phone2: String
1673
1674
  companyPhone: String
1674
1675
  companyPhone2: String
1675
1676
  otherPhone: 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
@@ -1774,8 +1776,6 @@ input ContactAttrsInput {
1774
1776
  workEmail2: String
1775
1777
  homeEmail: String
1776
1778
  homeEmail2: String
1777
- phone: String
1778
- phone2: String
1779
1779
  companyPhone: String
1780
1780
  companyPhone2: String
1781
1781
  otherPhone: String
@@ -2838,6 +2838,7 @@ input EnableTwoFactorAuthInput {
2838
2838
  twoFactorCode: String
2839
2839
  authToken: String
2840
2840
  csrfTokenSecured: Boolean!
2841
+ ignoreSameSite: Boolean
2841
2842
  }
2842
2843
 
2843
2844
  input ExternalAccountImportInput {
@@ -2861,7 +2862,7 @@ input GetDocumentShareURLItemInput {
2861
2862
 
2862
2863
  input Cursor {
2863
2864
  id: ID
2864
- sortField: String
2865
+ sortVal: String
2865
2866
  endSortVal: String
2866
2867
  includeOffset: Boolean
2867
2868
  }
@@ -3461,6 +3462,7 @@ type Mutation {
3461
3462
  twoFactorCode: String
3462
3463
  deviceTrusted: Boolean
3463
3464
  csrfTokenSecured: Boolean!
3465
+ ignoreSameSite: Boolean
3464
3466
  ): AuthResponse
3465
3467
  enableTwoFactorAuth(
3466
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
- let bodyType = type === 'text/html' ? 'html' : type === 'text/plain' && 'text';
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 if (
133
- //bodyType can be either 'text/html' or 'text/plain' so to handle such inline attachments the below condition is added
134
- part.filename &&
135
- bodyType &&
136
- disposition === 'inline'
137
- ) {
138
- (acc['inlineAttachments'] || (acc['inlineAttachments'] = [])).concat(
139
- processAttachment(part)
140
- );
141
- } else if (bodyType && (!acc[bodyType] || disposition !== 'inline')) {
142
- if ((bodyType === 'html' || bodyType === 'text') && acc[bodyType]) {
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 = disposition === 'inline' ? 'inlineAttachments' : 'attachments';
151
+ let mode = isInline ? 'inlineAttachments' : 'attachments';
155
152
 
156
153
  !ignoreContentTypeToShowAsAttachment.includes(part.contentType) &&
157
154
  (acc[mode] || (acc[mode] = [])).push(processAttachment(part, mode));
@@ -7,6 +7,7 @@ import { ContactInputRequest } from '../normalize/entities';
7
7
  const supportedContactAttributes = [
8
8
  'firstName',
9
9
  'phoneticFirstName',
10
+ 'phoneticCompany',
10
11
  'middleName',
11
12
  'lastName',
12
13
  'phoneticLastName',
@@ -20,8 +21,6 @@ const supportedContactAttributes = [
20
21
  'workEmail2',
21
22
  'homeEmail',
22
23
  'homeEmail2',
23
- 'phone',
24
- 'phone2',
25
24
  'companyPhone',
26
25
  'companyPhone2',
27
26
  'otherPhone',