@zimbra/api-client 98.0.0 → 99.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": "98.0.0",
4
+ "version": "99.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",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@apollo/client": "3.4.16",
51
- "@graphql-tools/schema": "^10.0.23",
51
+ "@graphql-tools/schema": "^10.0.25",
52
52
  "dataloader": "^2.2.2",
53
53
  "graphql": "^16.9.0",
54
54
  "lodash": "^4.17.21",
@@ -56,13 +56,13 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@babel/cli": "^7.17.10",
59
- "@babel/core": "^7.18.2",
59
+ "@babel/core": "^7.28.0",
60
60
  "@babel/plugin-proposal-class-properties": "^7.17.12",
61
61
  "@babel/preset-env": "^7.18.2",
62
62
  "@babel/preset-typescript": "^7.27.1",
63
63
  "@babel/register": "^7.17.7",
64
64
  "@graphql-codegen/cli": "^5.0.7",
65
- "@graphql-codegen/typescript": "^4.0.1",
65
+ "@graphql-codegen/typescript": "^4.1.6",
66
66
  "@rollup/plugin-babel": "^6.0.4",
67
67
  "@rollup/plugin-commonjs": "^28.0.5",
68
68
  "@rollup/plugin-graphql": "^1.1.0",
@@ -1,3 +1,4 @@
1
+ import { FieldFunctionOptions } from '@apollo/client';
1
2
  import { defaultDataIdFromObject, InMemoryCache, InMemoryCacheConfig } from '@apollo/client/core';
2
3
  import get from 'lodash/get';
3
4
  import uniqWith from 'lodash/uniqWith';
@@ -58,6 +59,29 @@ function createPossibleTypes(possibleTypesFactory = Object) {
58
59
  });
59
60
  }
60
61
 
62
+ function isReference(obj: any): obj is { __ref: string } {
63
+ return obj && typeof obj === 'object' && '__ref' in obj;
64
+ }
65
+
66
+ function resolvedRefrenceAddress(
67
+ address: EmailAddress[],
68
+ readField: FieldFunctionOptions['readField']
69
+ ) {
70
+ return (address || []).map(item => {
71
+ if (isReference(item)) {
72
+ return {
73
+ __typename: readField('__typename', item),
74
+ address: readField('address', item),
75
+ type: readField('type', item),
76
+ isGroup: readField('isGroup', item),
77
+ name: readField('name', item),
78
+ displayName: readField('displayName', item)
79
+ };
80
+ }
81
+ return item;
82
+ });
83
+ }
84
+
61
85
  const typePolicies = {
62
86
  Query: {
63
87
  fields: {
@@ -95,11 +119,17 @@ const typePolicies = {
95
119
  MessageInfo: {
96
120
  fields: {
97
121
  emailAddresses: {
98
- merge(existing: EmailAddress[], incoming: EmailAddress[]) {
99
- return uniqWith(
100
- [...(existing || []), ...(incoming || [])],
101
- (a, b) => a.address === b.address && a.type === b.type
102
- );
122
+ merge(
123
+ existing: EmailAddress[] = [],
124
+ incoming: EmailAddress[] = [],
125
+ { readField }: FieldFunctionOptions
126
+ ) {
127
+ const resolvedExisting = resolvedRefrenceAddress(existing, readField);
128
+ const resolvedIncoming = resolvedRefrenceAddress(incoming, readField);
129
+ const combined = [...(resolvedIncoming || []), ...(resolvedExisting || [])];
130
+ // Prefer entries where isGroup is not null
131
+ combined.sort((a, b) => Number(b.isGroup != null) - Number(a.isGroup != null));
132
+ return uniqWith(combined, (a, b) => a.address === b.address && a.type === b.type);
103
133
  }
104
134
  }
105
135
  }
@@ -385,7 +385,7 @@ export class ZimbraBatchClient {
385
385
  });
386
386
 
387
387
  public action = (type: ActionType, options: ActionOptions) => {
388
- const { ids, id, ...rest } = options;
388
+ const { ids, id, isBatchOperation, ...rest } = options;
389
389
 
390
390
  return this.jsonRequest({
391
391
  name: type,
@@ -395,7 +395,7 @@ export class ZimbraBatchClient {
395
395
  ...denormalize(ActionOptionsEntity)(rest)
396
396
  }
397
397
  },
398
- singleRequest: true
398
+ singleRequest: !isBatchOperation
399
399
  }).then(Boolean);
400
400
  };
401
401
 
@@ -264,6 +264,7 @@ export interface ActionOptions {
264
264
  folderId?: string;
265
265
  id?: string;
266
266
  ids?: Array<string>;
267
+ isBatchOperation?: boolean;
267
268
  isLocal?: boolean;
268
269
  name?: string;
269
270
  op: string;
@@ -87,12 +87,14 @@ const CalendarItemAttendees = new Entity({
87
87
  ptst: 'participationStatus',
88
88
  a: 'address',
89
89
  d: 'name',
90
- cutype: 'calendarUserType'
90
+ cutype: 'calendarUserType',
91
+ isGroup: 'isGroup'
91
92
  });
92
93
 
93
94
  const CalendarItemReply = new Entity({
94
95
  ptst: 'participationStatus',
95
- at: 'address'
96
+ at: 'address',
97
+ isGroup: 'isGroup'
96
98
  });
97
99
 
98
100
  const CalendarItemOrganizer = new Entity({
@@ -125,6 +125,7 @@ export type AccountInfoAttrs = {
125
125
  zimbraFeatureMailSendLaterEnabled?: Maybe<Scalars['Boolean']['output']>;
126
126
  zimbraFeatureManageZimlets?: Maybe<Scalars['Boolean']['output']>;
127
127
  zimbraFeatureMobileSyncEnabled?: Maybe<Scalars['Boolean']['output']>;
128
+ zimbraFeatureOptionsEnabled?: Maybe<Scalars['Boolean']['output']>;
128
129
  zimbraFeatureOutOfOfficeReplyEnabled?: Maybe<Scalars['Boolean']['output']>;
129
130
  zimbraFeaturePop3DataSourceEnabled?: Maybe<Scalars['Boolean']['output']>;
130
131
  zimbraFeaturePowerPasteEnabled?: Maybe<Scalars['Boolean']['output']>;
@@ -171,6 +172,7 @@ export type AccountInfoAttrs = {
171
172
  zimbraPasswordMinNumericChars?: Maybe<Scalars['Int']['output']>;
172
173
  zimbraPasswordMinPunctuationChars?: Maybe<Scalars['Int']['output']>;
173
174
  zimbraPasswordMinUpperCaseChars?: Maybe<Scalars['Int']['output']>;
175
+ zimbraPop3Enabled?: Maybe<Scalars['Boolean']['output']>;
174
176
  zimbraPublicSharingEnabled?: Maybe<Scalars['Boolean']['output']>;
175
177
  zimbraSignupAffiliate?: Maybe<Scalars['String']['output']>;
176
178
  zimbraSignupRecoveryEmail?: Maybe<Scalars['String']['output']>;
@@ -614,6 +616,7 @@ export type CalendarItemAttendee = {
614
616
  __typename?: 'CalendarItemAttendee';
615
617
  address?: Maybe<Scalars['String']['output']>;
616
618
  calendarUserType?: Maybe<Scalars['String']['output']>;
619
+ isGroup?: Maybe<Scalars['Boolean']['output']>;
617
620
  name?: Maybe<Scalars['String']['output']>;
618
621
  participationStatus?: Maybe<ParticipationStatus>;
619
622
  role?: Maybe<ParticipationRole>;
@@ -710,6 +713,7 @@ export type CalendarItemInviteComponentCounterInput = {
710
713
  percentComplete?: InputMaybe<Scalars['String']['input']>;
711
714
  priority?: InputMaybe<Scalars['String']['input']>;
712
715
  recurrence?: InputMaybe<CalendarItemRecurrenceInput>;
716
+ seq?: InputMaybe<Scalars['Int']['input']>;
713
717
  start: CalendarItemDateTimeInput;
714
718
  status?: InputMaybe<InviteCompletionStatus>;
715
719
  uid?: InputMaybe<Scalars['String']['input']>;
@@ -831,6 +835,7 @@ export type CalendarItemRecurrenceRuleInput = {
831
835
  export type CalendarItemReply = {
832
836
  __typename?: 'CalendarItemReply';
833
837
  address?: Maybe<Scalars['String']['output']>;
838
+ isGroup?: Maybe<Scalars['Boolean']['output']>;
834
839
  participationStatus?: Maybe<ParticipationStatus>;
835
840
  };
836
841
 
@@ -2759,6 +2764,7 @@ export type MutationActionArgs = {
2759
2764
  folderId?: InputMaybe<Scalars['ID']['input']>;
2760
2765
  id?: InputMaybe<Scalars['ID']['input']>;
2761
2766
  ids?: InputMaybe<Array<Scalars['ID']['input']>>;
2767
+ isBatchOperation?: InputMaybe<Scalars['Boolean']['input']>;
2762
2768
  isLocal?: InputMaybe<Scalars['Boolean']['input']>;
2763
2769
  name?: InputMaybe<Scalars['String']['input']>;
2764
2770
  op: Scalars['String']['input'];
@@ -2836,6 +2842,7 @@ export type MutationContactActionArgs = {
2836
2842
  folderId?: InputMaybe<Scalars['ID']['input']>;
2837
2843
  id?: InputMaybe<Scalars['ID']['input']>;
2838
2844
  ids?: InputMaybe<Array<Scalars['ID']['input']>>;
2845
+ isBatchOperation?: InputMaybe<Scalars['Boolean']['input']>;
2839
2846
  op: Scalars['String']['input'];
2840
2847
  tagNames?: InputMaybe<Scalars['String']['input']>;
2841
2848
  };
@@ -3024,6 +3031,7 @@ export type MutationItemActionArgs = {
3024
3031
  folderId?: InputMaybe<Scalars['ID']['input']>;
3025
3032
  id?: InputMaybe<Scalars['ID']['input']>;
3026
3033
  ids?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
3034
+ isBatchOperation?: InputMaybe<Scalars['Boolean']['input']>;
3027
3035
  name?: InputMaybe<Scalars['String']['input']>;
3028
3036
  op: Scalars['String']['input'];
3029
3037
  tagNames?: InputMaybe<Scalars['String']['input']>;
@@ -3414,6 +3422,13 @@ export type PolicyInput = {
3414
3422
  policy?: InputMaybe<Array<InputMaybe<PolicyAttrsInput>>>;
3415
3423
  };
3416
3424
 
3425
+ export enum Pop3DeleteOption {
3426
+ Delete = 'delete',
3427
+ Keep = 'keep',
3428
+ Read = 'read',
3429
+ Trash = 'trash'
3430
+ }
3431
+
3417
3432
  export enum PrefCalendarInitialView {
3418
3433
  Day = 'day',
3419
3434
  List = 'list',
@@ -3478,6 +3493,7 @@ export type Preferences = {
3478
3493
  zimbraPrefHtmlEditorDefaultFontColor?: Maybe<Scalars['String']['output']>;
3479
3494
  zimbraPrefHtmlEditorDefaultFontFamily?: Maybe<Scalars['String']['output']>;
3480
3495
  zimbraPrefHtmlEditorDefaultFontSize?: Maybe<Scalars['String']['output']>;
3496
+ zimbraPrefImapEnabled?: Maybe<Scalars['Boolean']['output']>;
3481
3497
  zimbraPrefLocale?: Maybe<Scalars['String']['output']>;
3482
3498
  zimbraPrefMailDeliveryStatusNotification?: Maybe<Scalars['Boolean']['output']>;
3483
3499
  zimbraPrefMailForwardingAddress?: Maybe<Scalars['String']['output']>;
@@ -3500,6 +3516,10 @@ export type Preferences = {
3500
3516
  zimbraPrefOutOfOfficeUntilDate?: Maybe<Scalars['String']['output']>;
3501
3517
  zimbraPrefPasswordRecoveryAddress?: Maybe<Scalars['String']['output']>;
3502
3518
  zimbraPrefPasswordRecoveryAddressStatus?: Maybe<PasswordRecoveryAddressStatus>;
3519
+ zimbraPrefPop3DeleteOption?: Maybe<Pop3DeleteOption>;
3520
+ zimbraPrefPop3DownloadSince?: Maybe<Scalars['String']['output']>;
3521
+ zimbraPrefPop3Enabled?: Maybe<Scalars['Boolean']['output']>;
3522
+ zimbraPrefPop3IncludeSpam?: Maybe<Scalars['Boolean']['output']>;
3503
3523
  zimbraPrefPowerPasteEnabled?: Maybe<Scalars['Boolean']['output']>;
3504
3524
  zimbraPrefPrimaryTwoFactorAuthMethod?: Maybe<Scalars['String']['output']>;
3505
3525
  zimbraPrefReadingPaneEnabled?: Maybe<Scalars['Boolean']['output']>;
@@ -3544,6 +3564,7 @@ export type PreferencesInput = {
3544
3564
  zimbraPrefHtmlEditorDefaultFontColor?: InputMaybe<Scalars['String']['input']>;
3545
3565
  zimbraPrefHtmlEditorDefaultFontFamily?: InputMaybe<Scalars['String']['input']>;
3546
3566
  zimbraPrefHtmlEditorDefaultFontSize?: InputMaybe<Scalars['String']['input']>;
3567
+ zimbraPrefImapEnabled?: InputMaybe<Scalars['Boolean']['input']>;
3547
3568
  zimbraPrefLocale?: InputMaybe<Scalars['String']['input']>;
3548
3569
  zimbraPrefMailDeliveryStatusNotification?: InputMaybe<Scalars['Boolean']['input']>;
3549
3570
  zimbraPrefMailForwardingAddress?: InputMaybe<Scalars['String']['input']>;
@@ -3564,6 +3585,10 @@ export type PreferencesInput = {
3564
3585
  zimbraPrefOutOfOfficeStatusAlertOnLogin?: InputMaybe<Scalars['Boolean']['input']>;
3565
3586
  zimbraPrefOutOfOfficeSuppressExternalReply?: InputMaybe<Scalars['Boolean']['input']>;
3566
3587
  zimbraPrefOutOfOfficeUntilDate?: InputMaybe<Scalars['String']['input']>;
3588
+ zimbraPrefPop3DeleteOption?: InputMaybe<Pop3DeleteOption>;
3589
+ zimbraPrefPop3DownloadSince?: InputMaybe<Scalars['String']['input']>;
3590
+ zimbraPrefPop3Enabled?: InputMaybe<Scalars['Boolean']['input']>;
3591
+ zimbraPrefPop3IncludeSpam?: InputMaybe<Scalars['Boolean']['input']>;
3567
3592
  zimbraPrefPowerPasteEnabled?: InputMaybe<Scalars['Boolean']['input']>;
3568
3593
  zimbraPrefPrimaryTwoFactorAuthMethod?: InputMaybe<Scalars['String']['input']>;
3569
3594
  zimbraPrefReadingPaneEnabled?: InputMaybe<Scalars['Boolean']['input']>;
@@ -4236,6 +4261,7 @@ export type SearchResponse = {
4236
4261
 
4237
4262
  export enum SearchType {
4238
4263
  Appointment = 'appointment',
4264
+ Briefcase = 'briefcase',
4239
4265
  Contact = 'contact',
4240
4266
  Conversation = 'conversation',
4241
4267
  Document = 'document',
@@ -203,6 +203,7 @@ enum SearchType {
203
203
  wiki
204
204
  document
205
205
  unknown
206
+ briefcase
206
207
  }
207
208
 
208
209
  enum ContactType {
@@ -322,6 +323,13 @@ enum PrefClientType {
322
323
  standard
323
324
  }
324
325
 
326
+ enum Pop3DeleteOption {
327
+ keep
328
+ read
329
+ trash
330
+ delete
331
+ }
332
+
325
333
  enum Mode {
326
334
  text
327
335
  html
@@ -1551,6 +1559,8 @@ type AccountInfoAttrs {
1551
1559
  zimbraFeatureAdvancedChatEnabled: Boolean
1552
1560
  zimbraMailIdleSessionTimeout: String
1553
1561
  zimbraFeatureDeliveryStatusNotificationEnabled: Boolean
1562
+ zimbraPop3Enabled: Boolean
1563
+ zimbraFeatureOptionsEnabled: Boolean
1554
1564
  }
1555
1565
 
1556
1566
  type AccountCos {
@@ -1702,6 +1712,11 @@ type Preferences {
1702
1712
  zimbraPrefDisplayTimeInMailList: Boolean
1703
1713
  zimbraPrefPrimaryTwoFactorAuthMethod: String
1704
1714
  zimbraPrefMailDeliveryStatusNotification: Boolean
1715
+ zimbraPrefImapEnabled: Boolean
1716
+ zimbraPrefPop3Enabled: Boolean
1717
+ zimbraPrefPop3DownloadSince: String
1718
+ zimbraPrefPop3IncludeSpam: Boolean
1719
+ zimbraPrefPop3DeleteOption: Pop3DeleteOption
1705
1720
  }
1706
1721
 
1707
1722
  type GetAppointmentResponse {
@@ -2429,7 +2444,8 @@ input CalendarItemInviteComponentCounterInput {
2429
2444
  status: InviteCompletionStatus
2430
2445
  noBlob: Boolean
2431
2446
  description: [CalendarItemInviteComponentDescriptionInput]
2432
- draft: Boolean
2447
+ draft: Boolean,
2448
+ seq: Int
2433
2449
  }
2434
2450
 
2435
2451
  type CalendarItemAttendee {
@@ -2439,11 +2455,13 @@ type CalendarItemAttendee {
2439
2455
  address: String
2440
2456
  name: String
2441
2457
  calendarUserType: String
2458
+ isGroup: Boolean
2442
2459
  }
2443
2460
 
2444
2461
  type CalendarItemReply {
2445
2462
  participationStatus: ParticipationStatus
2446
2463
  address: String
2464
+ isGroup: Boolean
2447
2465
  }
2448
2466
 
2449
2467
  input CalendarItemAttendeesInput {
@@ -2779,6 +2797,11 @@ input PreferencesInput {
2779
2797
  zimbraPrefPrimaryTwoFactorAuthMethod: String
2780
2798
  zimbraPrefDeleteInviteOnReply: Boolean
2781
2799
  zimbraPrefMailDeliveryStatusNotification: Boolean
2800
+ zimbraPrefImapEnabled: Boolean
2801
+ zimbraPrefPop3Enabled: Boolean
2802
+ zimbraPrefPop3DownloadSince: String
2803
+ zimbraPrefPop3IncludeSpam: Boolean
2804
+ zimbraPrefPop3DeleteOption: Pop3DeleteOption
2782
2805
  }
2783
2806
 
2784
2807
  input ModifyIdentityInput {
@@ -3694,6 +3717,7 @@ type Mutation {
3694
3717
  tagNames: String
3695
3718
  name: String
3696
3719
  isLocal: Boolean
3720
+ isBatchOperation: Boolean
3697
3721
  recursive: Boolean
3698
3722
  destFolderLocal: Boolean
3699
3723
  ): Boolean
@@ -3725,6 +3749,7 @@ type Mutation {
3725
3749
  folderId: ID
3726
3750
  op: String!
3727
3751
  tagNames: String
3752
+ isBatchOperation: Boolean
3728
3753
  ): ActionOpResponse
3729
3754
  conversationAction(ids: [ID!]!, op: String!): Boolean
3730
3755
  counterAppointment(
@@ -3787,6 +3812,7 @@ type Mutation {
3787
3812
  op: String!
3788
3813
  tagNames: String
3789
3814
  name: String
3815
+ isBatchOperation: Boolean
3790
3816
  ): Boolean
3791
3817
  importExternalAccount(externalAccount: ExternalAccountImportInput!): Boolean
3792
3818
  logout: Boolean