@zimbra/api-client 80.1.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": "80.1.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,
@@ -521,7 +521,8 @@ export const Document = new Entity({
521
521
  cd: 'revisedCreationDate',
522
522
  loid: 'lockOwnerId',
523
523
  ct: 'contentType',
524
- f: 'flags'
524
+ f: 'flags',
525
+ perm: 'permission'
525
526
  });
526
527
 
527
528
  export const ListDocumentRevisions = new Entity({
@@ -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 = {
@@ -1283,6 +1286,7 @@ export type Document = {
1283
1286
  metadataVersion?: Maybe<Scalars['Float']>;
1284
1287
  modifiedSequence?: Maybe<Scalars['Float']>;
1285
1288
  name?: Maybe<Scalars['String']>;
1289
+ permission?: Maybe<Scalars['String']>;
1286
1290
  revisedCreationDate?: Maybe<Scalars['Float']>;
1287
1291
  revision?: Maybe<Scalars['Float']>;
1288
1292
  revisonCreator?: Maybe<Scalars['String']>;
@@ -2250,6 +2254,7 @@ export type MessageInfo = MailItem & {
2250
2254
  isEncrypted?: Maybe<Scalars['Boolean']>;
2251
2255
  isSigned?: Maybe<Scalars['Boolean']>;
2252
2256
  local?: Maybe<Scalars['Boolean']>;
2257
+ meta?: Maybe<Array<Maybe<CustomMetadataMeta>>>;
2253
2258
  mimeParts?: Maybe<Array<Maybe<MimePart>>>;
2254
2259
  modifiedSequence?: Maybe<Scalars['Float']>;
2255
2260
  origId?: Maybe<Scalars['ID']>;
@@ -2606,6 +2611,7 @@ export type MutationCreateAppointmentExceptionArgs = {
2606
2611
  export type MutationCreateCalendarArgs = {
2607
2612
  color: Scalars['Int'];
2608
2613
  name: Scalars['String'];
2614
+ parentFolderId?: InputMaybe<Scalars['ID']>;
2609
2615
  url?: InputMaybe<Scalars['String']>;
2610
2616
  };
2611
2617
 
@@ -4001,7 +4007,7 @@ export type SignatureContentInput = {
4001
4007
  };
4002
4008
 
4003
4009
  export type SignatureInput = {
4004
- content?: InputMaybe<SignatureContentInput>;
4010
+ content?: InputMaybe<Array<InputMaybe<SignatureContentInput>>>;
4005
4011
  contentId?: InputMaybe<Scalars['String']>;
4006
4012
  id?: InputMaybe<Scalars['ID']>;
4007
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 {
@@ -1554,6 +1558,7 @@ type Document {
1554
1558
  revisedCreationDate: Float #cd
1555
1559
  lockOwnerId: ID #loid
1556
1560
  flags: String #f
1561
+ permission: String #perm
1557
1562
  docs: [Document]
1558
1563
  }
1559
1564
 
@@ -1630,7 +1635,7 @@ type CustomMetadataAttrs {
1630
1635
  }
1631
1636
 
1632
1637
  type CustomMetadataMeta {
1633
- section: String!
1638
+ section: String
1634
1639
  _attrs: [CustomMetadataAttrs]
1635
1640
  }
1636
1641
 
@@ -2898,7 +2903,7 @@ input DeleteAppointmentInput {
2898
2903
  input SignatureInput {
2899
2904
  id: ID
2900
2905
  name: String
2901
- content: SignatureContentInput
2906
+ content: [SignatureContentInput]
2902
2907
  contentId: String
2903
2908
  }
2904
2909
 
@@ -3414,7 +3419,7 @@ type Mutation {
3414
3419
  appointment: CalendarItemInput!
3415
3420
  ): Boolean
3416
3421
  createAppSpecificPassword(appName: String!): CreateAppSpecificPasswordResponse
3417
- createCalendar(name: String!, color: Int!, url: String): Folder
3422
+ createCalendar(name: String!, color: Int!, url: String, parentFolderId:ID): Folder
3418
3423
  createContact(contact: CreateContactInput!): Contact
3419
3424
  createContactList(contact: CreateContactInput!): Contact
3420
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({