@zimbra/api-client 98.0.0 → 100.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/.babelrc.json +1 -2
- package/dist/schema.graphql +37 -3
- package/dist/src/apollo/local-batch-link.d.ts +0 -1
- package/dist/src/apollo/offline-queue-link/index.d.ts +1 -4
- package/dist/src/batch-client/index.d.ts +4 -1
- package/dist/src/batch-client/types.d.ts +2 -1
- package/dist/src/normalize/entities.d.ts +1 -0
- package/dist/src/normalize/index.d.ts +1 -1
- package/dist/src/request/types.d.ts +0 -1
- package/dist/src/schema/generated-schema-types.d.ts +38 -2
- package/dist/src/utils/map-values-deep.d.ts +1 -0
- package/dist/zm-api-js-client.esm.js +660 -355
- package/dist/zm-api-js-client.esm.js.map +1 -1
- package/dist/zm-api-js-client.js +8 -8
- package/dist/zm-api-js-client.js.map +1 -1
- package/dist/zm-api-js-client.umd.js +8 -8
- package/dist/zm-api-js-client.umd.js.map +1 -1
- package/package-lock.json +832 -1399
- package/package.json +6 -6
- package/rollup.config.js +1 -1
- package/src/apollo/offline-queue-link/util.ts +1 -2
- package/src/apollo/zimbra-error-link.ts +4 -3
- package/src/apollo/zimbra-in-memory-cache.ts +38 -8
- package/src/batch-client/index.ts +74 -44
- package/src/batch-client/types.ts +2 -1
- package/src/normalize/entities.ts +10 -3
- package/src/normalize/index.ts +42 -39
- package/src/request/index.ts +36 -48
- package/src/request/types.ts +0 -1
- package/src/schema/generated-schema-types.ts +41 -2
- package/src/schema/schema.graphql +37 -3
- package/src/schema/schema.ts +3 -2
- package/src/schema/session-handler.ts +1 -2
- package/src/utils/map-values-deep.ts +10 -2
- package/src/utils/normalize-attrs-custommetadata.ts +5 -6
- package/src/utils/normalize-otherAttribute-contact.ts +29 -19
package/src/request/index.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import get from 'lodash/get';
|
|
2
|
-
import reduce from 'lodash/reduce';
|
|
3
1
|
import {
|
|
4
2
|
BatchRequestOptions,
|
|
5
3
|
BatchRequestResponse,
|
|
@@ -39,7 +37,7 @@ function parseJSON(response: Response): Promise<ParsedResponse> {
|
|
|
39
37
|
// for the rest of the cases (as of now only 500 error), parse and return the error response so that it can
|
|
40
38
|
// be handled properly by the caller
|
|
41
39
|
return parseErrorJSON(response).then(parsedResponse => {
|
|
42
|
-
const fault =
|
|
40
|
+
const fault = parsedResponse?.parsed?.Body?.Fault;
|
|
43
41
|
throw faultError(parsedResponse, [fault]);
|
|
44
42
|
});
|
|
45
43
|
}
|
|
@@ -71,7 +69,7 @@ function networkError(response: ParsedResponse) {
|
|
|
71
69
|
|
|
72
70
|
(error as NetworkError).message = message;
|
|
73
71
|
(error as NetworkError).response = response;
|
|
74
|
-
(error as NetworkError).parseError = response
|
|
72
|
+
(error as NetworkError).parseError = response?.parseError;
|
|
75
73
|
|
|
76
74
|
return error as NetworkError;
|
|
77
75
|
}
|
|
@@ -80,7 +78,7 @@ function faultReasonText(faults: any = []): string {
|
|
|
80
78
|
if (!Array.isArray(faults)) faults = [faults];
|
|
81
79
|
|
|
82
80
|
return faults
|
|
83
|
-
.map((f: any) =>
|
|
81
|
+
.map((f: any) => f?.Reason?.Text)
|
|
84
82
|
.filter(Boolean)
|
|
85
83
|
.join(', ');
|
|
86
84
|
}
|
|
@@ -88,7 +86,7 @@ function faultReasonText(faults: any = []): string {
|
|
|
88
86
|
function faultError(response: ParsedResponse, faults: any) {
|
|
89
87
|
const error = new Error(`Fault error: ${faults ? faultReasonText(faults) : 'Unknown Error'}`);
|
|
90
88
|
(error as SingleBatchRequestError).response = response;
|
|
91
|
-
(error as SingleBatchRequestError).parseError = response
|
|
89
|
+
(error as SingleBatchRequestError).parseError = response?.parseError;
|
|
92
90
|
(error as SingleBatchRequestError).faults = faults;
|
|
93
91
|
return error as SingleBatchRequestError;
|
|
94
92
|
}
|
|
@@ -98,20 +96,20 @@ function faultError(response: ParsedResponse, faults: any) {
|
|
|
98
96
|
* containing an array of the requests for that command.
|
|
99
97
|
*/
|
|
100
98
|
function batchBody(requests: ReadonlyArray<RequestOptions>) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
99
|
+
const body: { [key: string]: any } = {};
|
|
100
|
+
|
|
101
|
+
for (const request of requests) {
|
|
102
|
+
const key = `${request.name}Request`;
|
|
103
|
+
const value = soapCommandBody(request);
|
|
104
|
+
|
|
105
|
+
if (body[key]) {
|
|
106
|
+
body[key].push(value);
|
|
107
|
+
} else {
|
|
108
|
+
body[key] = [value];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return body;
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
/**
|
|
@@ -127,34 +125,26 @@ function batchResponse(requests: any, response: RequestResponse) {
|
|
|
127
125
|
// For each request type, track which responses have been
|
|
128
126
|
// pulled out of the batch request body by incrementing
|
|
129
127
|
// indexes.
|
|
130
|
-
|
|
128
|
+
const indexes: { [key: string]: number } = {};
|
|
129
|
+
const responses: Array<SingleBatchRequestResponse | SingleBatchRequestError> = [];
|
|
130
|
+
|
|
131
|
+
for (const request of requests) {
|
|
132
|
+
const batchResponses = batchBody[`${request.name}Response`];
|
|
133
|
+
const index = indexes[request.name] || 0;
|
|
134
|
+
const singleResponse = batchResponses?.[index];
|
|
135
|
+
|
|
136
|
+
if (singleResponse) {
|
|
137
|
+
responses.push({ body: singleResponse });
|
|
138
|
+
} else {
|
|
139
|
+
responses.push(faultError(request.originalResponse, batchBody.Fault));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
indexes[request.name] = index + 1;
|
|
143
|
+
}
|
|
131
144
|
|
|
132
145
|
return {
|
|
133
146
|
...res,
|
|
134
|
-
requests:
|
|
135
|
-
requests,
|
|
136
|
-
(responses: Array<SingleBatchRequestResponse | SingleBatchRequestError>, request) => {
|
|
137
|
-
const batchResponses = batchBody[`${request.name}Response`];
|
|
138
|
-
const index = indexes[request.name];
|
|
139
|
-
const response: any = batchResponses && batchResponses[index || 0];
|
|
140
|
-
if (response) {
|
|
141
|
-
responses.push({
|
|
142
|
-
body: response
|
|
143
|
-
});
|
|
144
|
-
} else {
|
|
145
|
-
responses.push(faultError(res.originalResponse, batchBody.Fault));
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
if (index) {
|
|
149
|
-
indexes[request.name] += 1;
|
|
150
|
-
} else {
|
|
151
|
-
indexes[request.name] = 1;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return responses;
|
|
155
|
-
},
|
|
156
|
-
[]
|
|
157
|
-
)
|
|
147
|
+
requests: responses
|
|
158
148
|
};
|
|
159
149
|
}
|
|
160
150
|
|
|
@@ -232,8 +222,6 @@ export function jsonRequest(requestOptions: JsonRequestOptions): Promise<Request
|
|
|
232
222
|
|
|
233
223
|
if (requestOptions.csrfToken) {
|
|
234
224
|
options.headers['X-Zimbra-Csrf-Token'] = requestOptions.csrfToken;
|
|
235
|
-
|
|
236
|
-
header.context.csrfToken = requestOptions.csrfToken;
|
|
237
225
|
}
|
|
238
226
|
|
|
239
227
|
// Allow to set Auth Token in Cookie in case `ZimbraBatchClient` is used on non-web platforms, like nodejs
|
|
@@ -267,7 +255,7 @@ export function jsonRequest(requestOptions: JsonRequestOptions): Promise<Request
|
|
|
267
255
|
})
|
|
268
256
|
.then(parseJSON)
|
|
269
257
|
.then((response: any) => {
|
|
270
|
-
const globalFault =
|
|
258
|
+
const globalFault = response?.parsed?.Body?.Fault;
|
|
271
259
|
|
|
272
260
|
if (globalFault) {
|
|
273
261
|
throw faultError(response, globalFault);
|
package/src/request/types.ts
CHANGED
|
@@ -101,6 +101,7 @@ export type AccountInfoAttrs = {
|
|
|
101
101
|
zimbraFeatureBriefcasesEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
102
102
|
zimbraFeatureCalendarEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
103
103
|
zimbraFeatureChangePasswordEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
104
|
+
zimbraFeatureContactsEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
104
105
|
zimbraFeatureConversationsEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
105
106
|
zimbraFeatureDeliveryStatusNotificationEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
106
107
|
zimbraFeatureDiscardInFiltersEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
@@ -125,6 +126,7 @@ export type AccountInfoAttrs = {
|
|
|
125
126
|
zimbraFeatureMailSendLaterEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
126
127
|
zimbraFeatureManageZimlets?: Maybe<Scalars['Boolean']['output']>;
|
|
127
128
|
zimbraFeatureMobileSyncEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
129
|
+
zimbraFeatureOptionsEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
128
130
|
zimbraFeatureOutOfOfficeReplyEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
129
131
|
zimbraFeaturePop3DataSourceEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
130
132
|
zimbraFeaturePowerPasteEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
@@ -171,6 +173,7 @@ export type AccountInfoAttrs = {
|
|
|
171
173
|
zimbraPasswordMinNumericChars?: Maybe<Scalars['Int']['output']>;
|
|
172
174
|
zimbraPasswordMinPunctuationChars?: Maybe<Scalars['Int']['output']>;
|
|
173
175
|
zimbraPasswordMinUpperCaseChars?: Maybe<Scalars['Int']['output']>;
|
|
176
|
+
zimbraPop3Enabled?: Maybe<Scalars['Boolean']['output']>;
|
|
174
177
|
zimbraPublicSharingEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
175
178
|
zimbraSignupAffiliate?: Maybe<Scalars['String']['output']>;
|
|
176
179
|
zimbraSignupRecoveryEmail?: Maybe<Scalars['String']['output']>;
|
|
@@ -614,6 +617,7 @@ export type CalendarItemAttendee = {
|
|
|
614
617
|
__typename?: 'CalendarItemAttendee';
|
|
615
618
|
address?: Maybe<Scalars['String']['output']>;
|
|
616
619
|
calendarUserType?: Maybe<Scalars['String']['output']>;
|
|
620
|
+
isGroup?: Maybe<Scalars['Boolean']['output']>;
|
|
617
621
|
name?: Maybe<Scalars['String']['output']>;
|
|
618
622
|
participationStatus?: Maybe<ParticipationStatus>;
|
|
619
623
|
role?: Maybe<ParticipationRole>;
|
|
@@ -710,6 +714,7 @@ export type CalendarItemInviteComponentCounterInput = {
|
|
|
710
714
|
percentComplete?: InputMaybe<Scalars['String']['input']>;
|
|
711
715
|
priority?: InputMaybe<Scalars['String']['input']>;
|
|
712
716
|
recurrence?: InputMaybe<CalendarItemRecurrenceInput>;
|
|
717
|
+
seq?: InputMaybe<Scalars['Int']['input']>;
|
|
713
718
|
start: CalendarItemDateTimeInput;
|
|
714
719
|
status?: InputMaybe<InviteCompletionStatus>;
|
|
715
720
|
uid?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -831,6 +836,7 @@ export type CalendarItemRecurrenceRuleInput = {
|
|
|
831
836
|
export type CalendarItemReply = {
|
|
832
837
|
__typename?: 'CalendarItemReply';
|
|
833
838
|
address?: Maybe<Scalars['String']['output']>;
|
|
839
|
+
isGroup?: Maybe<Scalars['Boolean']['output']>;
|
|
834
840
|
participationStatus?: Maybe<ParticipationStatus>;
|
|
835
841
|
};
|
|
836
842
|
|
|
@@ -1187,6 +1193,7 @@ export type CreateMountpointInput = {
|
|
|
1187
1193
|
export type CreateTagInput = {
|
|
1188
1194
|
color?: InputMaybe<Scalars['Int']['input']>;
|
|
1189
1195
|
name: Scalars['String']['input'];
|
|
1196
|
+
rgb?: InputMaybe<Scalars['String']['input']>;
|
|
1190
1197
|
};
|
|
1191
1198
|
|
|
1192
1199
|
export type CsrfToken = {
|
|
@@ -1711,7 +1718,7 @@ export type FilterCondition = {
|
|
|
1711
1718
|
__typename?: 'FilterCondition';
|
|
1712
1719
|
address?: Maybe<Array<Maybe<AddressCondition>>>;
|
|
1713
1720
|
addressBook?: Maybe<Array<Maybe<HeaderCheckCondition>>>;
|
|
1714
|
-
allOrAny
|
|
1721
|
+
allOrAny?: Maybe<FilterMatchCondition>;
|
|
1715
1722
|
attachment?: Maybe<Array<Maybe<BasicCondition>>>;
|
|
1716
1723
|
body?: Maybe<Array<Maybe<BodyCondition>>>;
|
|
1717
1724
|
bulk?: Maybe<Array<Maybe<BasicCondition>>>;
|
|
@@ -1855,6 +1862,7 @@ export type FolderActionInput = {
|
|
|
1855
1862
|
name?: InputMaybe<Scalars['String']['input']>;
|
|
1856
1863
|
op: Scalars['String']['input'];
|
|
1857
1864
|
retentionPolicy?: InputMaybe<Array<InputMaybe<RetentionPolicyInput>>>;
|
|
1865
|
+
rgb?: InputMaybe<Scalars['String']['input']>;
|
|
1858
1866
|
zimbraId?: InputMaybe<Scalars['ID']['input']>;
|
|
1859
1867
|
};
|
|
1860
1868
|
|
|
@@ -2420,6 +2428,7 @@ export type MailboxMetadataAttrs = {
|
|
|
2420
2428
|
zimbraPrefSMIMEDefaultSetting?: Maybe<Scalars['String']['output']>;
|
|
2421
2429
|
zimbraPrefSMIMELastOperation?: Maybe<Scalars['String']['output']>;
|
|
2422
2430
|
zimbraPrefSharedFolderTreeOpen?: Maybe<Scalars['Boolean']['output']>;
|
|
2431
|
+
zimbraPrefSidebarCollapsed?: Maybe<Scalars['Boolean']['output']>;
|
|
2423
2432
|
zimbraPrefSmartFolderTreeOpen?: Maybe<Scalars['Boolean']['output']>;
|
|
2424
2433
|
zimbraPrefTimeFormat?: Maybe<Scalars['String']['output']>;
|
|
2425
2434
|
zimbraPrefUndoSendEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
@@ -2453,6 +2462,7 @@ export type MailboxMetadataSectionAttrsInput = {
|
|
|
2453
2462
|
zimbraPrefSMIMEDefaultSetting?: InputMaybe<Scalars['String']['input']>;
|
|
2454
2463
|
zimbraPrefSMIMELastOperation?: InputMaybe<Scalars['String']['input']>;
|
|
2455
2464
|
zimbraPrefSharedFolderTreeOpen?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2465
|
+
zimbraPrefSidebarCollapsed?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2456
2466
|
zimbraPrefSmartFolderTreeOpen?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2457
2467
|
zimbraPrefTimeFormat?: InputMaybe<Scalars['String']['input']>;
|
|
2458
2468
|
zimbraPrefUndoSendEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
|
@@ -2759,6 +2769,7 @@ export type MutationActionArgs = {
|
|
|
2759
2769
|
folderId?: InputMaybe<Scalars['ID']['input']>;
|
|
2760
2770
|
id?: InputMaybe<Scalars['ID']['input']>;
|
|
2761
2771
|
ids?: InputMaybe<Array<Scalars['ID']['input']>>;
|
|
2772
|
+
isBatchOperation?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2762
2773
|
isLocal?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2763
2774
|
name?: InputMaybe<Scalars['String']['input']>;
|
|
2764
2775
|
op: Scalars['String']['input'];
|
|
@@ -2818,7 +2829,6 @@ export type MutationChangeFolderColorArgs = {
|
|
|
2818
2829
|
|
|
2819
2830
|
export type MutationChangePasswordArgs = {
|
|
2820
2831
|
authToken?: InputMaybe<Scalars['String']['input']>;
|
|
2821
|
-
csrfToken?: InputMaybe<Scalars['String']['input']>;
|
|
2822
2832
|
dryRun?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2823
2833
|
loginNewPassword: Scalars['String']['input'];
|
|
2824
2834
|
password: Scalars['String']['input'];
|
|
@@ -2836,6 +2846,7 @@ export type MutationContactActionArgs = {
|
|
|
2836
2846
|
folderId?: InputMaybe<Scalars['ID']['input']>;
|
|
2837
2847
|
id?: InputMaybe<Scalars['ID']['input']>;
|
|
2838
2848
|
ids?: InputMaybe<Array<Scalars['ID']['input']>>;
|
|
2849
|
+
isBatchOperation?: InputMaybe<Scalars['Boolean']['input']>;
|
|
2839
2850
|
op: Scalars['String']['input'];
|
|
2840
2851
|
tagNames?: InputMaybe<Scalars['String']['input']>;
|
|
2841
2852
|
};
|
|
@@ -3024,6 +3035,7 @@ export type MutationItemActionArgs = {
|
|
|
3024
3035
|
folderId?: InputMaybe<Scalars['ID']['input']>;
|
|
3025
3036
|
id?: InputMaybe<Scalars['ID']['input']>;
|
|
3026
3037
|
ids?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
|
|
3038
|
+
isBatchOperation?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3027
3039
|
name?: InputMaybe<Scalars['String']['input']>;
|
|
3028
3040
|
op: Scalars['String']['input'];
|
|
3029
3041
|
tagNames?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -3414,6 +3426,13 @@ export type PolicyInput = {
|
|
|
3414
3426
|
policy?: InputMaybe<Array<InputMaybe<PolicyAttrsInput>>>;
|
|
3415
3427
|
};
|
|
3416
3428
|
|
|
3429
|
+
export enum Pop3DeleteOption {
|
|
3430
|
+
Delete = 'delete',
|
|
3431
|
+
Keep = 'keep',
|
|
3432
|
+
Read = 'read',
|
|
3433
|
+
Trash = 'trash'
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3417
3436
|
export enum PrefCalendarInitialView {
|
|
3418
3437
|
Day = 'day',
|
|
3419
3438
|
List = 'list',
|
|
@@ -3473,11 +3492,13 @@ export type Preferences = {
|
|
|
3473
3492
|
zimbraPrefDisplayExternalImages?: Maybe<Scalars['Boolean']['output']>;
|
|
3474
3493
|
zimbraPrefDisplayTimeInMailList?: Maybe<Scalars['Boolean']['output']>;
|
|
3475
3494
|
zimbraPrefExternalSendersType?: Maybe<ExternalSendersType>;
|
|
3495
|
+
zimbraPrefFolderTreeOpen?: Maybe<Scalars['Boolean']['output']>;
|
|
3476
3496
|
zimbraPrefForwardReplyInOriginalFormat?: Maybe<Scalars['Boolean']['output']>;
|
|
3477
3497
|
zimbraPrefGroupMailBy?: Maybe<Scalars['String']['output']>;
|
|
3478
3498
|
zimbraPrefHtmlEditorDefaultFontColor?: Maybe<Scalars['String']['output']>;
|
|
3479
3499
|
zimbraPrefHtmlEditorDefaultFontFamily?: Maybe<Scalars['String']['output']>;
|
|
3480
3500
|
zimbraPrefHtmlEditorDefaultFontSize?: Maybe<Scalars['String']['output']>;
|
|
3501
|
+
zimbraPrefImapEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
3481
3502
|
zimbraPrefLocale?: Maybe<Scalars['String']['output']>;
|
|
3482
3503
|
zimbraPrefMailDeliveryStatusNotification?: Maybe<Scalars['Boolean']['output']>;
|
|
3483
3504
|
zimbraPrefMailForwardingAddress?: Maybe<Scalars['String']['output']>;
|
|
@@ -3500,6 +3521,10 @@ export type Preferences = {
|
|
|
3500
3521
|
zimbraPrefOutOfOfficeUntilDate?: Maybe<Scalars['String']['output']>;
|
|
3501
3522
|
zimbraPrefPasswordRecoveryAddress?: Maybe<Scalars['String']['output']>;
|
|
3502
3523
|
zimbraPrefPasswordRecoveryAddressStatus?: Maybe<PasswordRecoveryAddressStatus>;
|
|
3524
|
+
zimbraPrefPop3DeleteOption?: Maybe<Pop3DeleteOption>;
|
|
3525
|
+
zimbraPrefPop3DownloadSince?: Maybe<Scalars['String']['output']>;
|
|
3526
|
+
zimbraPrefPop3Enabled?: Maybe<Scalars['Boolean']['output']>;
|
|
3527
|
+
zimbraPrefPop3IncludeSpam?: Maybe<Scalars['Boolean']['output']>;
|
|
3503
3528
|
zimbraPrefPowerPasteEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
3504
3529
|
zimbraPrefPrimaryTwoFactorAuthMethod?: Maybe<Scalars['String']['output']>;
|
|
3505
3530
|
zimbraPrefReadingPaneEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
@@ -3539,11 +3564,13 @@ export type PreferencesInput = {
|
|
|
3539
3564
|
zimbraPrefDisplayExternalImages?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3540
3565
|
zimbraPrefDisplayTimeInMailList?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3541
3566
|
zimbraPrefExternalSendersType?: InputMaybe<ExternalSendersType>;
|
|
3567
|
+
zimbraPrefFolderTreeOpen?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3542
3568
|
zimbraPrefForwardReplyInOriginalFormat?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3543
3569
|
zimbraPrefGroupMailBy?: InputMaybe<Scalars['String']['input']>;
|
|
3544
3570
|
zimbraPrefHtmlEditorDefaultFontColor?: InputMaybe<Scalars['String']['input']>;
|
|
3545
3571
|
zimbraPrefHtmlEditorDefaultFontFamily?: InputMaybe<Scalars['String']['input']>;
|
|
3546
3572
|
zimbraPrefHtmlEditorDefaultFontSize?: InputMaybe<Scalars['String']['input']>;
|
|
3573
|
+
zimbraPrefImapEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3547
3574
|
zimbraPrefLocale?: InputMaybe<Scalars['String']['input']>;
|
|
3548
3575
|
zimbraPrefMailDeliveryStatusNotification?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3549
3576
|
zimbraPrefMailForwardingAddress?: InputMaybe<Scalars['String']['input']>;
|
|
@@ -3564,6 +3591,10 @@ export type PreferencesInput = {
|
|
|
3564
3591
|
zimbraPrefOutOfOfficeStatusAlertOnLogin?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3565
3592
|
zimbraPrefOutOfOfficeSuppressExternalReply?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3566
3593
|
zimbraPrefOutOfOfficeUntilDate?: InputMaybe<Scalars['String']['input']>;
|
|
3594
|
+
zimbraPrefPop3DeleteOption?: InputMaybe<Pop3DeleteOption>;
|
|
3595
|
+
zimbraPrefPop3DownloadSince?: InputMaybe<Scalars['String']['input']>;
|
|
3596
|
+
zimbraPrefPop3Enabled?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3597
|
+
zimbraPrefPop3IncludeSpam?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3567
3598
|
zimbraPrefPowerPasteEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3568
3599
|
zimbraPrefPrimaryTwoFactorAuthMethod?: InputMaybe<Scalars['String']['input']>;
|
|
3569
3600
|
zimbraPrefReadingPaneEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
|
@@ -3639,6 +3670,7 @@ export type Query = {
|
|
|
3639
3670
|
getHAB?: Maybe<HabGroup>;
|
|
3640
3671
|
getIdentities?: Maybe<Identities>;
|
|
3641
3672
|
getImportStatus?: Maybe<ImportStatusResponse>;
|
|
3673
|
+
getItem?: Maybe<Document>;
|
|
3642
3674
|
getMailboxMetadata?: Maybe<MailboxMetadata>;
|
|
3643
3675
|
getMessage?: Maybe<MessageInfo>;
|
|
3644
3676
|
getMessagesMetadata?: Maybe<Array<Maybe<MessageInfo>>>;
|
|
@@ -3811,6 +3843,11 @@ export type QueryGetHabArgs = {
|
|
|
3811
3843
|
};
|
|
3812
3844
|
|
|
3813
3845
|
|
|
3846
|
+
export type QueryGetItemArgs = {
|
|
3847
|
+
id: Scalars['ID']['input'];
|
|
3848
|
+
};
|
|
3849
|
+
|
|
3850
|
+
|
|
3814
3851
|
export type QueryGetMailboxMetadataArgs = {
|
|
3815
3852
|
section?: InputMaybe<Scalars['String']['input']>;
|
|
3816
3853
|
};
|
|
@@ -4147,6 +4184,7 @@ export enum SaveDocumentAction {
|
|
|
4147
4184
|
|
|
4148
4185
|
export type SaveDocumentInput = {
|
|
4149
4186
|
action?: InputMaybe<SaveDocumentAction>;
|
|
4187
|
+
content?: InputMaybe<Scalars['String']['input']>;
|
|
4150
4188
|
contentType?: InputMaybe<Scalars['String']['input']>;
|
|
4151
4189
|
descriptionEnabled?: InputMaybe<Scalars['Boolean']['input']>;
|
|
4152
4190
|
document?: InputMaybe<SaveDocumentInput>;
|
|
@@ -4236,6 +4274,7 @@ export type SearchResponse = {
|
|
|
4236
4274
|
|
|
4237
4275
|
export enum SearchType {
|
|
4238
4276
|
Appointment = 'appointment',
|
|
4277
|
+
Briefcase = 'briefcase',
|
|
4239
4278
|
Contact = 'contact',
|
|
4240
4279
|
Conversation = 'conversation',
|
|
4241
4280
|
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
|
|
@@ -1070,7 +1078,7 @@ type SizeCondition {
|
|
|
1070
1078
|
}
|
|
1071
1079
|
|
|
1072
1080
|
type FilterCondition {
|
|
1073
|
-
allOrAny: FilterMatchCondition
|
|
1081
|
+
allOrAny: FilterMatchCondition # condition
|
|
1074
1082
|
addressBook: [HeaderCheckCondition] # addressBookTest
|
|
1075
1083
|
address: [AddressCondition] # addressTest
|
|
1076
1084
|
attachment: [BasicCondition] # attachmentTest
|
|
@@ -1551,6 +1559,9 @@ type AccountInfoAttrs {
|
|
|
1551
1559
|
zimbraFeatureAdvancedChatEnabled: Boolean
|
|
1552
1560
|
zimbraMailIdleSessionTimeout: String
|
|
1553
1561
|
zimbraFeatureDeliveryStatusNotificationEnabled: Boolean
|
|
1562
|
+
zimbraPop3Enabled: Boolean
|
|
1563
|
+
zimbraFeatureOptionsEnabled: Boolean
|
|
1564
|
+
zimbraFeatureContactsEnabled: Boolean
|
|
1554
1565
|
}
|
|
1555
1566
|
|
|
1556
1567
|
type AccountCos {
|
|
@@ -1697,11 +1708,17 @@ type Preferences {
|
|
|
1697
1708
|
zimbraPrefUseTimeZoneListInCalendar: Boolean
|
|
1698
1709
|
zimbraPrefMailForwardingAddress: String
|
|
1699
1710
|
zimbraPrefMailLocalDeliveryDisabled: Boolean
|
|
1711
|
+
zimbraPrefFolderTreeOpen: Boolean
|
|
1700
1712
|
zimbraPrefTagTreeOpen: Boolean
|
|
1701
1713
|
zimbraPrefPowerPasteEnabled: Boolean
|
|
1702
1714
|
zimbraPrefDisplayTimeInMailList: Boolean
|
|
1703
1715
|
zimbraPrefPrimaryTwoFactorAuthMethod: String
|
|
1704
1716
|
zimbraPrefMailDeliveryStatusNotification: Boolean
|
|
1717
|
+
zimbraPrefImapEnabled: Boolean
|
|
1718
|
+
zimbraPrefPop3Enabled: Boolean
|
|
1719
|
+
zimbraPrefPop3DownloadSince: String
|
|
1720
|
+
zimbraPrefPop3IncludeSpam: Boolean
|
|
1721
|
+
zimbraPrefPop3DeleteOption: Pop3DeleteOption
|
|
1705
1722
|
}
|
|
1706
1723
|
|
|
1707
1724
|
type GetAppointmentResponse {
|
|
@@ -2136,6 +2153,7 @@ type MailboxMetadataAttrs {
|
|
|
2136
2153
|
zimbraPrefContactSourceFolderID: String
|
|
2137
2154
|
zimbraPrefHideMuteConvModal: Boolean
|
|
2138
2155
|
zimbraPrefColorMode: String
|
|
2156
|
+
zimbraPrefSidebarCollapsed: Boolean
|
|
2139
2157
|
}
|
|
2140
2158
|
|
|
2141
2159
|
type MailboxMetadataMeta {
|
|
@@ -2172,6 +2190,7 @@ input MailboxMetadataSectionAttrsInput {
|
|
|
2172
2190
|
zimbraPrefContactSourceFolderID: String
|
|
2173
2191
|
zimbraPrefHideMuteConvModal: Boolean
|
|
2174
2192
|
zimbraPrefColorMode: String
|
|
2193
|
+
zimbraPrefSidebarCollapsed: Boolean
|
|
2175
2194
|
}
|
|
2176
2195
|
|
|
2177
2196
|
type MimePart {
|
|
@@ -2429,7 +2448,8 @@ input CalendarItemInviteComponentCounterInput {
|
|
|
2429
2448
|
status: InviteCompletionStatus
|
|
2430
2449
|
noBlob: Boolean
|
|
2431
2450
|
description: [CalendarItemInviteComponentDescriptionInput]
|
|
2432
|
-
draft: Boolean
|
|
2451
|
+
draft: Boolean,
|
|
2452
|
+
seq: Int
|
|
2433
2453
|
}
|
|
2434
2454
|
|
|
2435
2455
|
type CalendarItemAttendee {
|
|
@@ -2439,11 +2459,13 @@ type CalendarItemAttendee {
|
|
|
2439
2459
|
address: String
|
|
2440
2460
|
name: String
|
|
2441
2461
|
calendarUserType: String
|
|
2462
|
+
isGroup: Boolean
|
|
2442
2463
|
}
|
|
2443
2464
|
|
|
2444
2465
|
type CalendarItemReply {
|
|
2445
2466
|
participationStatus: ParticipationStatus
|
|
2446
2467
|
address: String
|
|
2468
|
+
isGroup: Boolean
|
|
2447
2469
|
}
|
|
2448
2470
|
|
|
2449
2471
|
input CalendarItemAttendeesInput {
|
|
@@ -2621,6 +2643,7 @@ input FolderActionInput {
|
|
|
2621
2643
|
folderId: ID
|
|
2622
2644
|
zimbraId: ID
|
|
2623
2645
|
color: Int,
|
|
2646
|
+
rgb: String,
|
|
2624
2647
|
retentionPolicy: [RetentionPolicyInput]
|
|
2625
2648
|
}
|
|
2626
2649
|
|
|
@@ -2641,6 +2664,7 @@ input PolicyAttrsInput {
|
|
|
2641
2664
|
input CreateTagInput {
|
|
2642
2665
|
name: String!
|
|
2643
2666
|
color: Int
|
|
2667
|
+
rgb: String
|
|
2644
2668
|
}
|
|
2645
2669
|
|
|
2646
2670
|
# Special case of FolderAction for `changeFolderColor` resolver
|
|
@@ -2773,12 +2797,18 @@ input PreferencesInput {
|
|
|
2773
2797
|
zimbraPrefUseTimeZoneListInCalendar: Boolean
|
|
2774
2798
|
zimbraPrefMailForwardingAddress: String
|
|
2775
2799
|
zimbraPrefMailLocalDeliveryDisabled: Boolean
|
|
2800
|
+
zimbraPrefFolderTreeOpen: Boolean
|
|
2776
2801
|
zimbraPrefTagTreeOpen: Boolean
|
|
2777
2802
|
zimbraPrefPowerPasteEnabled: Boolean
|
|
2778
2803
|
zimbraPrefDisplayTimeInMailList: Boolean
|
|
2779
2804
|
zimbraPrefPrimaryTwoFactorAuthMethod: String
|
|
2780
2805
|
zimbraPrefDeleteInviteOnReply: Boolean
|
|
2781
2806
|
zimbraPrefMailDeliveryStatusNotification: Boolean
|
|
2807
|
+
zimbraPrefImapEnabled: Boolean
|
|
2808
|
+
zimbraPrefPop3Enabled: Boolean
|
|
2809
|
+
zimbraPrefPop3DownloadSince: String
|
|
2810
|
+
zimbraPrefPop3IncludeSpam: Boolean
|
|
2811
|
+
zimbraPrefPop3DeleteOption: Pop3DeleteOption
|
|
2782
2812
|
}
|
|
2783
2813
|
|
|
2784
2814
|
input ModifyIdentityInput {
|
|
@@ -3247,6 +3277,7 @@ input SaveDocumentInput {
|
|
|
3247
3277
|
name: String #name
|
|
3248
3278
|
version: Float #ver # Note :same item may have different versions (i.e same names) will need to implement ListDocumentRevisionsRequest
|
|
3249
3279
|
contentType: String #ct
|
|
3280
|
+
content: String
|
|
3250
3281
|
upload: uploadDocument #upload with a id
|
|
3251
3282
|
messageData: [messagePartForDocument] #m
|
|
3252
3283
|
descriptionEnabled: Boolean #descEnabled
|
|
@@ -3510,6 +3541,7 @@ type Query {
|
|
|
3510
3541
|
downloadAttachment(id: ID!, part: ID!): Attachment
|
|
3511
3542
|
downloadDocument(id: ID!, url: String!): Attachment
|
|
3512
3543
|
listDocumentRevisions(id: ID!, version: Int!, count: Int!): Document
|
|
3544
|
+
getItem(id: ID!): Document
|
|
3513
3545
|
discoverRights(right: [DiscoverRightInput!]!): DiscoverRights
|
|
3514
3546
|
freeBusy(names: [String!]!, start: Float, end: Float, excludeUid: String): [FreeBusy]
|
|
3515
3547
|
getContact(
|
|
@@ -3694,6 +3726,7 @@ type Mutation {
|
|
|
3694
3726
|
tagNames: String
|
|
3695
3727
|
name: String
|
|
3696
3728
|
isLocal: Boolean
|
|
3729
|
+
isBatchOperation: Boolean
|
|
3697
3730
|
recursive: Boolean
|
|
3698
3731
|
destFolderLocal: Boolean
|
|
3699
3732
|
): Boolean
|
|
@@ -3712,7 +3745,6 @@ type Mutation {
|
|
|
3712
3745
|
password: String!
|
|
3713
3746
|
username: String!
|
|
3714
3747
|
authToken: String
|
|
3715
|
-
csrfToken: String
|
|
3716
3748
|
): AuthResponse
|
|
3717
3749
|
modifyProfileImage(
|
|
3718
3750
|
content: String
|
|
@@ -3725,6 +3757,7 @@ type Mutation {
|
|
|
3725
3757
|
folderId: ID
|
|
3726
3758
|
op: String!
|
|
3727
3759
|
tagNames: String
|
|
3760
|
+
isBatchOperation: Boolean
|
|
3728
3761
|
): ActionOpResponse
|
|
3729
3762
|
conversationAction(ids: [ID!]!, op: String!): Boolean
|
|
3730
3763
|
counterAppointment(
|
|
@@ -3787,6 +3820,7 @@ type Mutation {
|
|
|
3787
3820
|
op: String!
|
|
3788
3821
|
tagNames: String
|
|
3789
3822
|
name: String
|
|
3823
|
+
isBatchOperation: Boolean
|
|
3790
3824
|
): Boolean
|
|
3791
3825
|
importExternalAccount(externalAccount: ExternalAccountImportInput!): Boolean
|
|
3792
3826
|
logout: Boolean
|
package/src/schema/schema.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeExecutableSchema } from '@graphql-tools/schema';
|
|
2
|
-
import mapValues from '
|
|
2
|
+
import { mapValues } from 'es-toolkit';
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
ActionOpResponse,
|
|
@@ -113,6 +113,7 @@ export function createZimbraSchema(options: ZimbraSchemaOptions): {
|
|
|
113
113
|
downloadAttachment: (_, variables) => client.downloadAttachment(variables),
|
|
114
114
|
downloadDocument: (_, variables) => client.downloadDocument(variables),
|
|
115
115
|
listDocumentRevisions: (_, variables) => client.listDocumentRevisions(variables),
|
|
116
|
+
getItem: (_, variables) => client.getItem(variables),
|
|
116
117
|
downloadMessage: (_, variables, context = {}) => {
|
|
117
118
|
const { local } = context;
|
|
118
119
|
|
|
@@ -414,7 +415,7 @@ export function createZimbraSchema(options: ZimbraSchemaOptions): {
|
|
|
414
415
|
body: {
|
|
415
416
|
meta: {
|
|
416
417
|
section: variables.section,
|
|
417
|
-
_attrs: mapValues(variables.attrs, coerceBooleanToString)
|
|
418
|
+
_attrs: mapValues(variables.attrs || {}, coerceBooleanToString)
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
})
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { gql } from '@apollo/client/core';
|
|
2
|
-
import get from 'lodash/get';
|
|
3
2
|
import { ZimbraInMemoryCache } from '../apollo/zimbra-in-memory-cache';
|
|
4
3
|
import { ZimbraSessionOptions } from './types';
|
|
5
4
|
|
|
@@ -22,7 +21,7 @@ export class SessionHandler {
|
|
|
22
21
|
id: this.cacheKeyForSession,
|
|
23
22
|
fragment: SESSION_GQL_FRAGMENT
|
|
24
23
|
});
|
|
25
|
-
return
|
|
24
|
+
return sessionIdFragment?.id || '1';
|
|
26
25
|
};
|
|
27
26
|
|
|
28
27
|
public writeSessionId = (sessionId: string) => {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import mapValues from '
|
|
1
|
+
import { mapValues } from 'es-toolkit';
|
|
2
2
|
|
|
3
3
|
export function mapValuesDeep(obj: {}, callback: (v: any) => any): {} {
|
|
4
|
-
if (typeof obj !== 'object') {
|
|
4
|
+
if (obj === null || typeof obj !== 'object') {
|
|
5
5
|
return callback(obj);
|
|
6
6
|
} else if (Array.isArray(obj)) {
|
|
7
7
|
return obj.map(v => mapValuesDeep(v, callback));
|
|
8
8
|
}
|
|
9
9
|
return mapValues(obj, v => mapValuesDeep(v, callback));
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
export function getValueByPath(obj: any, path: string): any {
|
|
13
|
+
if (!path) return undefined;
|
|
14
|
+
|
|
15
|
+
return path
|
|
16
|
+
.split('.')
|
|
17
|
+
.reduce((acc, key) => (acc && typeof acc === 'object' ? acc[key] : undefined), obj);
|
|
18
|
+
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import forEach from 'lodash/forEach';
|
|
2
|
-
|
|
3
1
|
export function setCustomMetaDataBody(data: any) {
|
|
4
2
|
const { attrs, id, section } = data;
|
|
5
|
-
const customMetaAttrs
|
|
3
|
+
const customMetaAttrs: Object[] = [];
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
for (const { key, value } of attrs) {
|
|
8
6
|
customMetaAttrs.push({
|
|
9
7
|
[key]: value
|
|
10
|
-
})
|
|
11
|
-
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
12
11
|
return {
|
|
13
12
|
id,
|
|
14
13
|
meta: {
|