@zimbra/api-client 81.0.0 → 82.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.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zimbra/api-client",
3
3
  "amdName": "zmApiJsClient",
4
- "version": "81.0.0",
4
+ "version": "82.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",
@@ -159,6 +159,16 @@ function normalizeMessage(
159
159
  message: { [key: string]: any },
160
160
  { origin, jwtToken, isDesktop }: { isDesktop?: string; jwtToken?: string; origin?: string }
161
161
  ) {
162
+ if (message?.meta) {
163
+ message.meta = message.meta.map((entry: any) => {
164
+ if (!entry._attrs) {
165
+ entry._attrs = {};
166
+ }
167
+ entry = normalizeCustomMetaDataAttrs(entry);
168
+ return entry;
169
+ });
170
+ }
171
+
162
172
  let normalizedMessage = normalize(MessageInfo)(message);
163
173
  normalizedMessage = normalizedMessage && mapValuesDeep(normalizedMessage, coerceStringToBoolean);
164
174
 
@@ -239,7 +249,7 @@ function updateAbsoluteFolderPath(originalName: any, parentFolderAbsPath: string
239
249
  }
240
250
 
241
251
  if (folder.folders) {
242
- folder.folders = updateAbsoluteFolderPath(originalName, folder.absFolderPath, folder.folders);
252
+ folder.folders = updateAbsoluteFolderPath(folder.oname, folder.absFolderPath, folder.folders);
243
253
  }
244
254
  return folder;
245
255
  });
@@ -984,7 +994,8 @@ export class ZimbraBatchClient {
984
994
  c: mapValues(options, coerceBooleanToInt)
985
995
  }
986
996
  }).then(res => {
987
- const c = normalize(Conversation)(res.c[0]);
997
+ const conversation = this.normalizeConversation(res.c[0]);
998
+ const c = normalize(Conversation)(conversation);
988
999
  c.messages = c.messages.map(this.normalizeMessage);
989
1000
  return c;
990
1001
  });
@@ -1746,6 +1757,9 @@ export class ZimbraBatchClient {
1746
1757
  res.cn = normalizeOtherAttr(res.cn);
1747
1758
  }
1748
1759
  const normalized = normalize(SearchResponse)(res);
1760
+ if (normalized.conversations) {
1761
+ normalized.conversations = normalized.conversations.map(this.normalizeConversation);
1762
+ }
1749
1763
  if (normalized.messages) {
1750
1764
  normalized.messages = normalized.messages.map(this.normalizeMessage);
1751
1765
  }
@@ -2023,6 +2037,20 @@ export class ZimbraBatchClient {
2023
2037
  })
2024
2038
  });
2025
2039
 
2040
+ private normalizeConversation = (conversation: { [key: string]: any }) => {
2041
+ if (conversation?.meta) {
2042
+ conversation.meta = conversation.meta.map((entry: any) => {
2043
+ if (!entry._attrs) {
2044
+ entry._attrs = {};
2045
+ }
2046
+ entry = normalizeCustomMetaDataAttrs(entry);
2047
+ return entry;
2048
+ });
2049
+ }
2050
+
2051
+ return conversation;
2052
+ };
2053
+
2026
2054
  private normalizeMessage = (message: any) =>
2027
2055
  normalizeMessage(message, {
2028
2056
  origin: this.origin,
@@ -79,6 +79,7 @@ export type AccountInfo = {
79
79
  export type AccountInfoAttrs = {
80
80
  __typename?: 'AccountInfoAttrs';
81
81
  displayName?: Maybe<Scalars['String']>;
82
+ zimbraBlockEmailSendFromImapPop?: Maybe<Scalars['Boolean']>;
82
83
  zimbraBrandingFolderName?: Maybe<Scalars['String']>;
83
84
  zimbraDomainTrialConvertAtExpiration?: Maybe<Scalars['Boolean']>;
84
85
  zimbraDomainTrialExpirationDate?: Maybe<Scalars['String']>;
@@ -793,6 +794,7 @@ export type CancelRuleInfo = {
793
794
  export type ClientInfoAttributes = {
794
795
  __typename?: 'ClientInfoAttributes';
795
796
  zimbraFeatureResetPasswordStatus?: Maybe<ResetPasswordStatus>;
797
+ zimbraHelpModernURL?: Maybe<Scalars['String']>;
796
798
  zimbraWebClientLoginURL?: Maybe<Scalars['String']>;
797
799
  zimbraWebClientLogoutURL?: Maybe<Scalars['String']>;
798
800
  zimbraWebClientSkipLogoff?: Maybe<Scalars['Boolean']>;
@@ -1053,6 +1055,7 @@ export type Conversation = MailItem & {
1053
1055
  invitations?: Maybe<Array<Maybe<InviteInfo>>>;
1054
1056
  messages?: Maybe<Array<Maybe<MessageInfo>>>;
1055
1057
  messagesMetaData?: Maybe<Array<Maybe<MessageInfo>>>;
1058
+ meta?: Maybe<Array<Maybe<CustomMetadataMeta>>>;
1056
1059
  modifiedSequence?: Maybe<Scalars['Float']>;
1057
1060
  numMessages?: Maybe<Scalars['Float']>;
1058
1061
  replyType?: Maybe<Scalars['String']>;
@@ -1161,7 +1164,7 @@ export type CustomMetadataInput = {
1161
1164
  export type CustomMetadataMeta = {
1162
1165
  __typename?: 'CustomMetadataMeta';
1163
1166
  _attrs?: Maybe<Array<Maybe<CustomMetadataAttrs>>>;
1164
- section: Scalars['String'];
1167
+ section?: Maybe<Scalars['String']>;
1165
1168
  };
1166
1169
 
1167
1170
  export type DataSource = {
@@ -2251,6 +2254,7 @@ export type MessageInfo = MailItem & {
2251
2254
  isEncrypted?: Maybe<Scalars['Boolean']>;
2252
2255
  isSigned?: Maybe<Scalars['Boolean']>;
2253
2256
  local?: Maybe<Scalars['Boolean']>;
2257
+ meta?: Maybe<Array<Maybe<CustomMetadataMeta>>>;
2254
2258
  mimeParts?: Maybe<Array<Maybe<MimePart>>>;
2255
2259
  modifiedSequence?: Maybe<Scalars['Float']>;
2256
2260
  origId?: Maybe<Scalars['ID']>;
@@ -2607,6 +2611,7 @@ export type MutationCreateAppointmentExceptionArgs = {
2607
2611
  export type MutationCreateCalendarArgs = {
2608
2612
  color: Scalars['Int'];
2609
2613
  name: Scalars['String'];
2614
+ parentFolderId?: InputMaybe<Scalars['ID']>;
2610
2615
  url?: InputMaybe<Scalars['String']>;
2611
2616
  };
2612
2617
 
@@ -4002,7 +4007,7 @@ export type SignatureContentInput = {
4002
4007
  };
4003
4008
 
4004
4009
  export type SignatureInput = {
4005
- content?: InputMaybe<SignatureContentInput>;
4010
+ content?: InputMaybe<Array<InputMaybe<SignatureContentInput>>>;
4006
4011
  contentId?: InputMaybe<Scalars['String']>;
4007
4012
  id?: InputMaybe<Scalars['ID']>;
4008
4013
  name?: InputMaybe<Scalars['String']>;
@@ -487,6 +487,7 @@ type ClientInfoAttributes {
487
487
  zimbraWebClientLogoutURL: String
488
488
  zimbraWebClientSkipLogoff: Boolean
489
489
  zimbraFeatureResetPasswordStatus: ResetPasswordStatus
490
+ zimbraHelpModernURL: String
490
491
  }
491
492
 
492
493
  type ClientInfoType {
@@ -535,6 +536,7 @@ type MessageInfo implements MailItem {
535
536
  autoSendTime: Float
536
537
  local: Boolean
537
538
  part: String
539
+ meta: [CustomMetadataMeta]
538
540
  }
539
541
 
540
542
  type Conversation implements MailItem {
@@ -561,6 +563,7 @@ type Conversation implements MailItem {
561
563
  unread: Float # u
562
564
  share: [ShareNotification] # shr
563
565
  replyType: String #rt
566
+ meta: [CustomMetadataMeta]
564
567
  }
565
568
 
566
569
  type MsgWithGroupInfo implements MailItem {
@@ -1369,6 +1372,7 @@ type AccountInfoAttrs {
1369
1372
  zimbraTrialExpirationDate: String
1370
1373
  zimbraTrialConvertAtExpiration: Boolean
1371
1374
  zimbraHierarchicalAddressBookRoot: String
1375
+ zimbraBlockEmailSendFromImapPop: Boolean
1372
1376
  }
1373
1377
 
1374
1378
  type AccountCos {
@@ -1631,7 +1635,7 @@ type CustomMetadataAttrs {
1631
1635
  }
1632
1636
 
1633
1637
  type CustomMetadataMeta {
1634
- section: String!
1638
+ section: String
1635
1639
  _attrs: [CustomMetadataAttrs]
1636
1640
  }
1637
1641
 
@@ -2899,7 +2903,7 @@ input DeleteAppointmentInput {
2899
2903
  input SignatureInput {
2900
2904
  id: ID
2901
2905
  name: String
2902
- content: SignatureContentInput
2906
+ content: [SignatureContentInput]
2903
2907
  contentId: String
2904
2908
  }
2905
2909
 
@@ -3415,7 +3419,7 @@ type Mutation {
3415
3419
  appointment: CalendarItemInput!
3416
3420
  ): Boolean
3417
3421
  createAppSpecificPassword(appName: String!): CreateAppSpecificPasswordResponse
3418
- createCalendar(name: String!, color: Int!, url: String): Folder
3422
+ createCalendar(name: String!, color: Int!, url: String, parentFolderId:ID): Folder
3419
3423
  createContact(contact: CreateContactInput!): Contact
3420
3424
  createContactList(contact: CreateContactInput!): Contact
3421
3425
  modifyContact(contact: ModifyContactInput!): Contact
@@ -278,13 +278,14 @@ export function createZimbraSchema(options: ZimbraSchemaOptions): {
278
278
  client.checkCalendar(variables as FolderActionCheckCalendarInput),
279
279
  counterAppointment: (_, { counterAppointmentInvite }) =>
280
280
  client.counterAppointment(counterAppointmentInvite as CounterAppointmentInput),
281
- createCalendar: (_, { name, color, url }) =>
281
+ createCalendar: (_, { name, color, url, parentFolderId }) =>
282
282
  client.createFolder({
283
283
  name,
284
284
  color,
285
285
  url,
286
286
  view: 'appointment',
287
- flags: '#'
287
+ flags: '#',
288
+ parentFolderId
288
289
  } as CreateFolderOptions),
289
290
  createSharedCalendar: (_, { link }) =>
290
291
  client.createMountpoint({