@zimbra/api-client 103.0.1-master.e2fc2e1.0 → 103.0.1-master.f5b7ef4.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": "103.0.1-master.e2fc2e1.0",
4
+ "version": "103.0.1-master.f5b7ef4.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",
@@ -125,6 +125,7 @@ import {
125
125
  AutoCompleteGALOptions,
126
126
  AutoCompleteOptions,
127
127
  ChangePasswordOptions,
128
+ CheckSpellingOptions,
128
129
  CreateFolderOptions,
129
130
  CreateSearchFolderOptions,
130
131
  DiscoverRightOptions,
@@ -141,6 +142,7 @@ import {
141
142
  GetMessageOptions,
142
143
  GetSMimePublicCertsOptions,
143
144
  LoginOptions,
145
+ Misspelled,
144
146
  ModifyProfileImageOptions,
145
147
  NoOpOptions,
146
148
  RecoverAccountOptions,
@@ -2123,6 +2125,29 @@ export class ZimbraBatchClient {
2123
2125
  });
2124
2126
  };
2125
2127
 
2128
+ public checkSpelling = ({ text, ignore }: CheckSpellingOptions) =>
2129
+ this.jsonRequest({
2130
+ name: 'CheckSpelling',
2131
+ body: { _content: text, ignore: ignore?.join(',') }
2132
+ }).then(response => ({
2133
+ available: response.available,
2134
+ misspelled: (response.misspelled || []).map((m: Misspelled) => ({
2135
+ word: m.word,
2136
+ suggestions: (m.suggestions || '').split(',').filter(Boolean)
2137
+ }))
2138
+ }));
2139
+
2140
+ public addToSpellCheckDictionary = (word: string) => {
2141
+ return this.jsonRequest({
2142
+ name: 'ModifyPrefs',
2143
+ namespace: Namespace.Account,
2144
+ body: {
2145
+ _attrs: { '+zimbraPrefSpellIgnoreWord': word }
2146
+ },
2147
+ singleRequest: true
2148
+ }).then(Boolean);
2149
+ };
2150
+
2126
2151
  private batchDataHandler = (requests: ReadonlyArray<RequestOptions>) =>
2127
2152
  batchJsonRequest({
2128
2153
  requests,
@@ -378,3 +378,13 @@ export interface DiscoverRightInput {
378
378
  export interface DiscoverRightOptions {
379
379
  right: Array<DiscoverRightInput>;
380
380
  }
381
+
382
+ export interface CheckSpellingOptions {
383
+ text: string;
384
+ ignore?: Array<string>;
385
+ }
386
+
387
+ export interface Misspelled {
388
+ word: string;
389
+ suggestions: string;
390
+ }
@@ -66,6 +66,7 @@ export type AccountInfo = {
66
66
  cos?: Maybe<AccountCos>;
67
67
  habRoots?: Maybe<HabRoots>;
68
68
  id: Scalars['ID']['output'];
69
+ isSpellCheckAvailable?: Maybe<Scalars['Boolean']['output']>;
69
70
  license?: Maybe<License>;
70
71
  name?: Maybe<Scalars['String']['output']>;
71
72
  pasteitcleanedEnabled?: Maybe<Scalars['Boolean']['output']>;
@@ -854,6 +855,12 @@ export type CancelRuleInfo = {
854
855
  tz?: Maybe<Scalars['String']['output']>;
855
856
  };
856
857
 
858
+ export type CheckSpellingResponse = {
859
+ __typename?: 'CheckSpellingResponse';
860
+ available?: Maybe<Scalars['Boolean']['output']>;
861
+ misspelled?: Maybe<Array<Maybe<Misspelling>>>;
862
+ };
863
+
857
864
  export type ClientInfoAttributes = {
858
865
  __typename?: 'ClientInfoAttributes';
859
866
  zimbraClassicWebClientDisabled?: Maybe<Scalars['Boolean']['output']>;
@@ -2599,6 +2606,12 @@ export type MimePartInput = {
2599
2606
  url?: InputMaybe<Scalars['String']['input']>;
2600
2607
  };
2601
2608
 
2609
+ export type Misspelling = {
2610
+ __typename?: 'Misspelling';
2611
+ suggestions?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
2612
+ word?: Maybe<Scalars['String']['output']>;
2613
+ };
2614
+
2602
2615
  export enum Mode {
2603
2616
  Html = 'html',
2604
2617
  Text = 'text'
@@ -2668,6 +2681,7 @@ export type Mutation = {
2668
2681
  action?: Maybe<Scalars['Boolean']['output']>;
2669
2682
  addExternalAccount?: Maybe<Scalars['ID']['output']>;
2670
2683
  addMessage?: Maybe<MessageInfo>;
2684
+ addToSpellCheckDictionary?: Maybe<Scalars['Boolean']['output']>;
2671
2685
  allowDeviceSync?: Maybe<Device>;
2672
2686
  applyFilterRules?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
2673
2687
  blockDeviceSync?: Maybe<Device>;
@@ -2798,6 +2812,11 @@ export type MutationAddMessageArgs = {
2798
2812
  };
2799
2813
 
2800
2814
 
2815
+ export type MutationAddToSpellCheckDictionaryArgs = {
2816
+ word: Scalars['String']['input'];
2817
+ };
2818
+
2819
+
2801
2820
  export type MutationAllowDeviceSyncArgs = {
2802
2821
  deviceId?: InputMaybe<Scalars['String']['input']>;
2803
2822
  };
@@ -3523,6 +3542,7 @@ export type Preferences = {
3523
3542
  zimbraPrefMailSendReadReceipts?: Maybe<PrefMailSendReadReceipts>;
3524
3543
  zimbraPrefMailToasterEnabled?: Maybe<Scalars['Boolean']['output']>;
3525
3544
  zimbraPrefMailTrustedSenderList?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
3545
+ zimbraPrefMandatorySpellCheckEnabled?: Maybe<Scalars['Boolean']['output']>;
3526
3546
  zimbraPrefMarkMsgRead?: Maybe<Scalars['Int']['output']>;
3527
3547
  zimbraPrefMessageViewHtmlPreferred?: Maybe<Scalars['Boolean']['output']>;
3528
3548
  zimbraPrefOutOfOfficeExternalReply?: Maybe<Scalars['String']['output']>;
@@ -3549,6 +3569,7 @@ export type Preferences = {
3549
3569
  zimbraPrefShowFragments?: Maybe<Scalars['Boolean']['output']>;
3550
3570
  zimbraPrefSlackCalendarReminderEnabled?: Maybe<Scalars['Boolean']['output']>;
3551
3571
  zimbraPrefSortOrder?: Maybe<Scalars['String']['output']>;
3572
+ zimbraPrefSpellDictionary?: Maybe<Scalars['String']['output']>;
3552
3573
  zimbraPrefTagTreeOpen?: Maybe<Scalars['Boolean']['output']>;
3553
3574
  zimbraPrefTimeZoneId?: Maybe<Scalars['String']['output']>;
3554
3575
  zimbraPrefUseTimeZoneListInCalendar?: Maybe<Scalars['Boolean']['output']>;
@@ -3596,6 +3617,7 @@ export type PreferencesInput = {
3596
3617
  zimbraPrefMailSendReadReceipts?: InputMaybe<PrefMailSendReadReceipts>;
3597
3618
  zimbraPrefMailToasterEnabled?: InputMaybe<Scalars['Boolean']['input']>;
3598
3619
  zimbraPrefMailTrustedSenderList?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
3620
+ zimbraPrefMandatorySpellCheckEnabled?: InputMaybe<Scalars['Boolean']['input']>;
3599
3621
  zimbraPrefMarkMsgRead?: InputMaybe<Scalars['Int']['input']>;
3600
3622
  zimbraPrefMessageViewHtmlPreferred?: InputMaybe<Scalars['Boolean']['input']>;
3601
3623
  zimbraPrefOutOfOfficeExternalReply?: InputMaybe<Scalars['String']['input']>;
@@ -3660,6 +3682,7 @@ export type Query = {
3660
3682
  accountInfo?: Maybe<AccountInfo>;
3661
3683
  autoComplete?: Maybe<AutoCompleteResponse>;
3662
3684
  autoCompleteGAL?: Maybe<AutoCompleteGalResponse>;
3685
+ checkSpelling?: Maybe<CheckSpellingResponse>;
3663
3686
  clientInfo?: Maybe<ClientInfoType>;
3664
3687
  discoverRights?: Maybe<DiscoverRights>;
3665
3688
  downloadAttachment?: Maybe<Attachment>;
@@ -3731,6 +3754,12 @@ export type QueryAutoCompleteGalArgs = {
3731
3754
  };
3732
3755
 
3733
3756
 
3757
+ export type QueryCheckSpellingArgs = {
3758
+ ignore?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
3759
+ text: Scalars['String']['input'];
3760
+ };
3761
+
3762
+
3734
3763
  export type QueryClientInfoArgs = {
3735
3764
  by?: InputMaybe<Scalars['String']['input']>;
3736
3765
  domain?: InputMaybe<Scalars['String']['input']>;
@@ -1399,6 +1399,7 @@ type AccountInfo {
1399
1399
  cos: AccountCos
1400
1400
  pasteitcleanedEnabled: Boolean
1401
1401
  adminDelegated: Boolean
1402
+ isSpellCheckAvailable: Boolean
1402
1403
  }
1403
1404
 
1404
1405
  type OnlyEmailAddress {
@@ -1670,6 +1671,8 @@ type Preferences {
1670
1671
  zimbraPrefComposeDirection: String
1671
1672
  zimbraPrefComposeFormat: Mode
1672
1673
  zimbraPrefForwardReplyInOriginalFormat: Boolean
1674
+ zimbraPrefMandatorySpellCheckEnabled: Boolean
1675
+ zimbraPrefSpellDictionary: String
1673
1676
  zimbraPrefHtmlEditorDefaultFontColor: String
1674
1677
  zimbraPrefHtmlEditorDefaultFontFamily: String
1675
1678
  zimbraPrefHtmlEditorDefaultFontSize: String
@@ -2764,6 +2767,7 @@ input PreferencesInput {
2764
2767
  zimbraPrefComposeDirection: String
2765
2768
  zimbraPrefComposeFormat: Mode
2766
2769
  zimbraPrefForwardReplyInOriginalFormat: Boolean
2770
+ zimbraPrefMandatorySpellCheckEnabled: Boolean
2767
2771
  zimbraPrefExternalSendersType: ExternalSendersType
2768
2772
  zimbraPrefHtmlEditorDefaultFontColor: String
2769
2773
  zimbraPrefHtmlEditorDefaultFontFamily: String
@@ -3531,6 +3535,16 @@ input DiscoverRightInput {
3531
3535
  _content: String
3532
3536
  }
3533
3537
 
3538
+ type Misspelling {
3539
+ word: String
3540
+ suggestions: [String]
3541
+ }
3542
+
3543
+ type CheckSpellingResponse {
3544
+ available: Boolean
3545
+ misspelled: [Misspelling]
3546
+ }
3547
+
3534
3548
  # Zimbra GraphQL Queries
3535
3549
  # - [[SOAP API Reference]](https://files.zimbra.com/docs/soap_api/8.7.11/api-reference/index.html)
3536
3550
  # - [[SOAP Documentation]](https://github.com/Zimbra/zm-mailbox/blob/develop/store/docs/soap.txt)
@@ -3724,6 +3738,11 @@ type Query {
3724
3738
  taskFolders: [Folder]
3725
3739
 
3726
3740
  getTag: [Tag]
3741
+
3742
+ checkSpelling(
3743
+ text: String!
3744
+ ignore: [String]
3745
+ ): CheckSpellingResponse
3727
3746
  }
3728
3747
 
3729
3748
  type Mutation {
@@ -3937,6 +3956,7 @@ type Mutation {
3937
3956
  subscribeDistributionList(op: String!, by: String, dl: String!): String
3938
3957
  distributionListAction(dlActions: DistributionListActionInput!): Boolean
3939
3958
  bounceMessage(message: RedirectMessgeInput): Boolean
3959
+ addToSpellCheckDictionary(word: String!): Boolean
3940
3960
  }
3941
3961
 
3942
3962
  schema {
@@ -57,6 +57,7 @@ import {
57
57
  AutoCompleteGALOptions,
58
58
  AutoCompleteOptions,
59
59
  ChangePasswordOptions,
60
+ CheckSpellingOptions,
60
61
  ClientInfoInput,
61
62
  CreateFolderOptions,
62
63
  CreateSearchFolderOptions,
@@ -212,7 +213,8 @@ export function createZimbraSchema(options: ZimbraSchemaOptions): {
212
213
  taskFolders: client.taskFolders,
213
214
  getWhiteBlackList: client.getWhiteBlackList,
214
215
  getAppSpecificPasswords: client.getAppSpecificPasswords,
215
- getTag: client.getTag
216
+ getTag: client.getTag,
217
+ checkSpelling: (_, variables) => client.checkSpelling(variables as CheckSpellingOptions)
216
218
  },
217
219
  //resolveType is necessary to differentiate for any Union or Interfaces
218
220
  MailItem: {
@@ -457,7 +459,8 @@ export function createZimbraSchema(options: ZimbraSchemaOptions): {
457
459
  subscribeDistributionList: (_, { op, by, dl }) =>
458
460
  client.subscribeDistributionList(op, by, dl),
459
461
  distributionListAction: (_, { dlActions }) =>
460
- client.distributionListAction(dlActions as DistributionListActionInput)
462
+ client.distributionListAction(dlActions as DistributionListActionInput),
463
+ addToSpellCheckDictionary: (_, { word }) => client.addToSpellCheckDictionary(word)
461
464
  }
462
465
  }
463
466
  });