@zimbra/api-client 90.0.0 → 91.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/dist/schema.graphql +19 -1
- package/dist/src/apollo/types.d.ts +8 -0
- package/dist/src/schema/generated-schema-types.d.ts +17 -0
- package/dist/src/utils/normalize-attrs-custommetadata.d.ts +1 -0
- package/dist/zm-api-js-client.esm.js +18 -3
- package/dist/zm-api-js-client.esm.js.map +1 -1
- package/dist/zm-api-js-client.js +2 -2
- package/dist/zm-api-js-client.js.map +1 -1
- package/dist/zm-api-js-client.umd.js +2 -2
- package/dist/zm-api-js-client.umd.js.map +1 -1
- package/package-lock.json +4 -4
- package/package.json +1 -1
- package/src/apollo/types.ts +9 -0
- package/src/apollo/zimbra-in-memory-cache.ts +6 -4
- package/src/batch-client/index.ts +4 -0
- package/src/schema/generated-schema-types.ts +19 -0
- package/src/schema/schema.graphql +19 -1
- package/src/utils/normalize-attrs-custommetadata.ts +9 -0
package/package-lock.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zimbra/api-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "91.0.0",
|
|
4
4
|
"lockfileVersion": 1,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"dependencies": {
|
|
@@ -5438,7 +5438,7 @@
|
|
|
5438
5438
|
"cross-spawn": {
|
|
5439
5439
|
"version": "5.1.0",
|
|
5440
5440
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
|
|
5441
|
-
"integrity": "
|
|
5441
|
+
"integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==",
|
|
5442
5442
|
"dev": true,
|
|
5443
5443
|
"requires": {
|
|
5444
5444
|
"lru-cache": "^4.0.1",
|
|
@@ -8924,7 +8924,7 @@
|
|
|
8924
8924
|
"shebang-command": {
|
|
8925
8925
|
"version": "1.2.0",
|
|
8926
8926
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
|
8927
|
-
"integrity": "
|
|
8927
|
+
"integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
|
|
8928
8928
|
"dev": true,
|
|
8929
8929
|
"requires": {
|
|
8930
8930
|
"shebang-regex": "^1.0.0"
|
|
@@ -8933,7 +8933,7 @@
|
|
|
8933
8933
|
"shebang-regex": {
|
|
8934
8934
|
"version": "1.0.0",
|
|
8935
8935
|
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
|
8936
|
-
"integrity": "
|
|
8936
|
+
"integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
|
|
8937
8937
|
"dev": true
|
|
8938
8938
|
},
|
|
8939
8939
|
"shell-quote": {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zimbra/api-client",
|
|
3
3
|
"amdName": "zmApiJsClient",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "91.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",
|
package/src/apollo/types.ts
CHANGED
|
@@ -5,3 +5,12 @@ export interface LocalBatchLinkOptions extends BatchLink.Options {
|
|
|
5
5
|
context?: any;
|
|
6
6
|
schema: GraphQLSchema;
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
export interface EmailAddress {
|
|
10
|
+
__typename?: 'EmailAddress';
|
|
11
|
+
address?: string;
|
|
12
|
+
displayName?: string;
|
|
13
|
+
isGroup?: boolean | null;
|
|
14
|
+
name?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { defaultDataIdFromObject, InMemoryCache, InMemoryCacheConfig } from '@apollo/client/core';
|
|
2
2
|
import get from 'lodash/get';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
4
|
+
import uniqWith from 'lodash/uniqWith';
|
|
5
|
+
import { EmailAddress } from './types';
|
|
3
6
|
|
|
4
7
|
const dataIdFromPath = (result: any, path: string) => {
|
|
5
8
|
if (result.__typename) {
|
|
@@ -93,10 +96,9 @@ const typePolicies = {
|
|
|
93
96
|
MessageInfo: {
|
|
94
97
|
fields: {
|
|
95
98
|
emailAddresses: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
merge: false
|
|
99
|
+
merge(existing: EmailAddress[], incoming: EmailAddress[]) {
|
|
100
|
+
return uniqWith([...(existing || []), ...(incoming || [])], isEqual);
|
|
101
|
+
}
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
}
|
|
@@ -103,6 +103,7 @@ import {
|
|
|
103
103
|
import { mapValuesDeep } from '../utils/map-values-deep';
|
|
104
104
|
import {
|
|
105
105
|
normalizeCustomMetaDataAttrs,
|
|
106
|
+
normalizeHeaderAttrs,
|
|
106
107
|
setCustomMetaDataBody
|
|
107
108
|
} from '../utils/normalize-attrs-custommetadata';
|
|
108
109
|
import { normalizeEmailAddresses } from '../utils/normalize-email-addresses';
|
|
@@ -171,6 +172,9 @@ function normalizeMessage(
|
|
|
171
172
|
return entry;
|
|
172
173
|
});
|
|
173
174
|
}
|
|
175
|
+
if (message?._attrs) {
|
|
176
|
+
message._attrs = normalizeHeaderAttrs(message._attrs);
|
|
177
|
+
}
|
|
174
178
|
|
|
175
179
|
let normalizedMessage = normalize(MessageInfo)(message);
|
|
176
180
|
normalizedMessage = normalizedMessage && mapValuesDeep(normalizedMessage, coerceStringToBoolean);
|
|
@@ -124,6 +124,7 @@ export type AccountInfoAttrs = {
|
|
|
124
124
|
zimbraFeatureRelatedContactsEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
125
125
|
zimbraFeatureResetPasswordStatus?: Maybe<ResetPasswordStatus>;
|
|
126
126
|
zimbraFeatureRetentionPolicyEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
127
|
+
zimbraFeatureSharedFolderMobileSyncEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
127
128
|
zimbraFeatureSharingEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
128
129
|
zimbraFeatureTaggingEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
129
130
|
zimbraFeatureTasksEnabled?: Maybe<Scalars['Boolean']['output']>;
|
|
@@ -837,6 +838,7 @@ export type CancelRuleInfo = {
|
|
|
837
838
|
|
|
838
839
|
export type ClientInfoAttributes = {
|
|
839
840
|
__typename?: 'ClientInfoAttributes';
|
|
841
|
+
zimbraClassicWebClientDisabled?: Maybe<Scalars['Boolean']['output']>;
|
|
840
842
|
zimbraFeatureResetPasswordStatus?: Maybe<ResetPasswordStatus>;
|
|
841
843
|
zimbraHelpModernURL?: Maybe<Scalars['String']['output']>;
|
|
842
844
|
zimbraWebClientLoginURL?: Maybe<Scalars['String']['output']>;
|
|
@@ -1089,6 +1091,7 @@ export enum ContactType {
|
|
|
1089
1091
|
|
|
1090
1092
|
export type Conversation = MailItem & {
|
|
1091
1093
|
__typename?: 'Conversation';
|
|
1094
|
+
_attrs?: Maybe<Array<Maybe<CustomHeader>>>;
|
|
1092
1095
|
changeDate?: Maybe<Scalars['Float']['output']>;
|
|
1093
1096
|
conversationId?: Maybe<Scalars['ID']['output']>;
|
|
1094
1097
|
date?: Maybe<Scalars['Float']['output']>;
|
|
@@ -1185,6 +1188,12 @@ export type Cursor = {
|
|
|
1185
1188
|
sortVal?: InputMaybe<Scalars['String']['input']>;
|
|
1186
1189
|
};
|
|
1187
1190
|
|
|
1191
|
+
export type CustomHeader = {
|
|
1192
|
+
__typename?: 'CustomHeader';
|
|
1193
|
+
key?: Maybe<Scalars['String']['output']>;
|
|
1194
|
+
value?: Maybe<Scalars['String']['output']>;
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1188
1197
|
export type CustomMetadata = {
|
|
1189
1198
|
__typename?: 'CustomMetadata';
|
|
1190
1199
|
meta?: Maybe<Array<Maybe<CustomMetadataMeta>>>;
|
|
@@ -2043,6 +2052,11 @@ export type HeaderConditionInput = {
|
|
|
2043
2052
|
valueComparison?: InputMaybe<Scalars['String']['input']>;
|
|
2044
2053
|
};
|
|
2045
2054
|
|
|
2055
|
+
export type HeaderInput = {
|
|
2056
|
+
_content?: InputMaybe<Scalars['String']['input']>;
|
|
2057
|
+
name?: InputMaybe<Scalars['String']['input']>;
|
|
2058
|
+
};
|
|
2059
|
+
|
|
2046
2060
|
export type Hit = {
|
|
2047
2061
|
__typename?: 'Hit';
|
|
2048
2062
|
id?: Maybe<Scalars['String']['output']>;
|
|
@@ -2433,6 +2447,7 @@ export type MessageAttributes = {
|
|
|
2433
2447
|
|
|
2434
2448
|
export type MessageInfo = MailItem & {
|
|
2435
2449
|
__typename?: 'MessageInfo';
|
|
2450
|
+
_attrs?: Maybe<Array<Maybe<CustomHeader>>>;
|
|
2436
2451
|
attachments?: Maybe<Array<Maybe<MimePart>>>;
|
|
2437
2452
|
attributes?: Maybe<MessageAttributes>;
|
|
2438
2453
|
autoSendTime?: Maybe<Scalars['Float']['output']>;
|
|
@@ -2575,6 +2590,7 @@ export type ModifyZimletPrefsResponse = {
|
|
|
2575
2590
|
|
|
2576
2591
|
export type MsgWithGroupInfo = MailItem & {
|
|
2577
2592
|
__typename?: 'MsgWithGroupInfo';
|
|
2593
|
+
_attrs?: Maybe<Array<Maybe<CustomHeader>>>;
|
|
2578
2594
|
autoSendTime?: Maybe<Scalars['Float']['output']>;
|
|
2579
2595
|
changeDate?: Maybe<Scalars['Float']['output']>;
|
|
2580
2596
|
cif?: Maybe<Scalars['String']['output']>;
|
|
@@ -3866,6 +3882,7 @@ export type QuerySearchArgs = {
|
|
|
3866
3882
|
cursor?: InputMaybe<Cursor>;
|
|
3867
3883
|
fetch?: InputMaybe<Scalars['String']['input']>;
|
|
3868
3884
|
fullConversation?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3885
|
+
header?: InputMaybe<Array<InputMaybe<MailItemHeaderInput>>>;
|
|
3869
3886
|
inDumpster?: InputMaybe<Scalars['Boolean']['input']>;
|
|
3870
3887
|
limit?: InputMaybe<Scalars['Int']['input']>;
|
|
3871
3888
|
memberOf?: InputMaybe<Scalars['Boolean']['input']>;
|
|
@@ -4205,6 +4222,7 @@ export type SendMessageInput = {
|
|
|
4205
4222
|
entityId?: InputMaybe<Scalars['String']['input']>;
|
|
4206
4223
|
flags?: InputMaybe<Scalars['String']['input']>;
|
|
4207
4224
|
folderId?: InputMaybe<Scalars['ID']['input']>;
|
|
4225
|
+
header?: InputMaybe<Array<InputMaybe<HeaderInput>>>;
|
|
4208
4226
|
id?: InputMaybe<Scalars['ID']['input']>;
|
|
4209
4227
|
inReplyTo?: InputMaybe<Scalars['String']['input']>;
|
|
4210
4228
|
inlineAttachments?: InputMaybe<Array<InputMaybe<MimePartInput>>>;
|
|
@@ -4248,6 +4266,7 @@ export enum SetRecoveryAccountOp {
|
|
|
4248
4266
|
|
|
4249
4267
|
export type ShareInfo = {
|
|
4250
4268
|
__typename?: 'ShareInfo';
|
|
4269
|
+
activeSyncDisabled?: Maybe<Scalars['Boolean']['output']>;
|
|
4251
4270
|
folderId: Scalars['ID']['output'];
|
|
4252
4271
|
folderPath?: Maybe<Scalars['String']['output']>;
|
|
4253
4272
|
folderUuid?: Maybe<Scalars['String']['output']>;
|
|
@@ -510,6 +510,7 @@ type ClientInfoAttributes {
|
|
|
510
510
|
zimbraWebClientSkipLogoff: Boolean
|
|
511
511
|
zimbraFeatureResetPasswordStatus: ResetPasswordStatus
|
|
512
512
|
zimbraHelpModernURL: String
|
|
513
|
+
zimbraClassicWebClientDisabled: Boolean
|
|
513
514
|
}
|
|
514
515
|
|
|
515
516
|
type ClientInfoType {
|
|
@@ -560,6 +561,7 @@ type MessageInfo implements MailItem {
|
|
|
560
561
|
local: Boolean
|
|
561
562
|
part: String
|
|
562
563
|
meta: [CustomMetadataMeta]
|
|
564
|
+
_attrs: [CustomHeader]
|
|
563
565
|
}
|
|
564
566
|
|
|
565
567
|
type Conversation implements MailItem {
|
|
@@ -588,6 +590,7 @@ type Conversation implements MailItem {
|
|
|
588
590
|
subscribe: [DLSubscribe] # dlSub
|
|
589
591
|
replyType: String #rt
|
|
590
592
|
meta: [CustomMetadataMeta]
|
|
593
|
+
_attrs: [CustomHeader]
|
|
591
594
|
}
|
|
592
595
|
|
|
593
596
|
type MsgWithGroupInfo implements MailItem {
|
|
@@ -604,6 +607,7 @@ type MsgWithGroupInfo implements MailItem {
|
|
|
604
607
|
folderId: ID # l
|
|
605
608
|
subject: String # su
|
|
606
609
|
emailAddresses: [EmailAddress]
|
|
610
|
+
_attrs: [CustomHeader]
|
|
607
611
|
excerpt: String # fr
|
|
608
612
|
conversationId: ID # cid
|
|
609
613
|
flags: String # f
|
|
@@ -1478,6 +1482,7 @@ type AccountInfoAttrs {
|
|
|
1478
1482
|
zimbraFeatureFiltersEnabled: Boolean
|
|
1479
1483
|
zimbraFeatureReadReceiptsEnabled: Boolean
|
|
1480
1484
|
zimbraFeatureSharingEnabled: Boolean
|
|
1485
|
+
zimbraFeatureSharedFolderMobileSyncEnabled: Boolean
|
|
1481
1486
|
zimbraFeatureManageZimlets: Boolean
|
|
1482
1487
|
zimbraFeatureTwoFactorAuthAvailable: Boolean
|
|
1483
1488
|
zimbraFeatureTwoFactorAuthRequired: Boolean
|
|
@@ -1782,6 +1787,11 @@ type SaveDraftResponse {
|
|
|
1782
1787
|
message: [MessageInfo]
|
|
1783
1788
|
}
|
|
1784
1789
|
|
|
1790
|
+
type CustomHeader {
|
|
1791
|
+
key: String
|
|
1792
|
+
value: String
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1785
1795
|
type CustomMetadataAttrs {
|
|
1786
1796
|
key: String
|
|
1787
1797
|
value: String
|
|
@@ -2072,6 +2082,7 @@ type ShareInfo {
|
|
|
2072
2082
|
rights: String
|
|
2073
2083
|
view: FolderView
|
|
2074
2084
|
mid: ID
|
|
2085
|
+
activeSyncDisabled: Boolean
|
|
2075
2086
|
}
|
|
2076
2087
|
|
|
2077
2088
|
type MailboxMetadataAttrs {
|
|
@@ -2305,6 +2316,12 @@ input SendMessageInput {
|
|
|
2305
2316
|
emailAddresses: [MailItemEmailAddressInput] #e
|
|
2306
2317
|
attachments: [AttachmentInput] #attach
|
|
2307
2318
|
inlineAttachments: [MimePartInput] #attach
|
|
2319
|
+
header: [HeaderInput] #header
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
input HeaderInput {
|
|
2323
|
+
name: String #name
|
|
2324
|
+
_content: String #value
|
|
2308
2325
|
}
|
|
2309
2326
|
|
|
2310
2327
|
input SaveSMimeCertInputUpload {
|
|
@@ -3594,7 +3611,8 @@ type Query {
|
|
|
3594
3611
|
sortBy: SortBy
|
|
3595
3612
|
types: SearchType
|
|
3596
3613
|
resultMode: String
|
|
3597
|
-
inDumpster: Boolean
|
|
3614
|
+
inDumpster: Boolean,
|
|
3615
|
+
header: [MailItemHeaderInput]
|
|
3598
3616
|
): SearchResponse
|
|
3599
3617
|
|
|
3600
3618
|
searchCalendarResources(
|
|
@@ -29,3 +29,12 @@ export function normalizeCustomMetaDataAttrs(data: any) {
|
|
|
29
29
|
_attrs: attrs
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
export function normalizeHeaderAttrs(data: any) {
|
|
34
|
+
let attrs: any = [];
|
|
35
|
+
|
|
36
|
+
Object.keys(data).forEach(
|
|
37
|
+
key => typeof data[key] === 'string' && attrs.push({ key, value: data[key] })
|
|
38
|
+
);
|
|
39
|
+
return attrs;
|
|
40
|
+
}
|