@zimbra/api-client 103.0.0 → 103.0.1-PREAPPS-9724.27b2a1a.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.0",
4
+ "version": "103.0.1-PREAPPS-9724.27b2a1a.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
+ }
@@ -854,6 +854,12 @@ export type CancelRuleInfo = {
854
854
  tz?: Maybe<Scalars['String']['output']>;
855
855
  };
856
856
 
857
+ export type CheckSpellingResponse = {
858
+ __typename?: 'CheckSpellingResponse';
859
+ available?: Maybe<Scalars['Boolean']['output']>;
860
+ misspelled?: Maybe<Array<Maybe<Misspelling>>>;
861
+ };
862
+
857
863
  export type ClientInfoAttributes = {
858
864
  __typename?: 'ClientInfoAttributes';
859
865
  zimbraClassicWebClientDisabled?: Maybe<Scalars['Boolean']['output']>;
@@ -2599,6 +2605,12 @@ export type MimePartInput = {
2599
2605
  url?: InputMaybe<Scalars['String']['input']>;
2600
2606
  };
2601
2607
 
2608
+ export type Misspelling = {
2609
+ __typename?: 'Misspelling';
2610
+ suggestions?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
2611
+ word?: Maybe<Scalars['String']['output']>;
2612
+ };
2613
+
2602
2614
  export enum Mode {
2603
2615
  Html = 'html',
2604
2616
  Text = 'text'
@@ -2668,6 +2680,7 @@ export type Mutation = {
2668
2680
  action?: Maybe<Scalars['Boolean']['output']>;
2669
2681
  addExternalAccount?: Maybe<Scalars['ID']['output']>;
2670
2682
  addMessage?: Maybe<MessageInfo>;
2683
+ addToSpellCheckDictionary?: Maybe<Scalars['Boolean']['output']>;
2671
2684
  allowDeviceSync?: Maybe<Device>;
2672
2685
  applyFilterRules?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
2673
2686
  blockDeviceSync?: Maybe<Device>;
@@ -2798,6 +2811,11 @@ export type MutationAddMessageArgs = {
2798
2811
  };
2799
2812
 
2800
2813
 
2814
+ export type MutationAddToSpellCheckDictionaryArgs = {
2815
+ word?: InputMaybe<Scalars['String']['input']>;
2816
+ };
2817
+
2818
+
2801
2819
  export type MutationAllowDeviceSyncArgs = {
2802
2820
  deviceId?: InputMaybe<Scalars['String']['input']>;
2803
2821
  };
@@ -3523,6 +3541,7 @@ export type Preferences = {
3523
3541
  zimbraPrefMailSendReadReceipts?: Maybe<PrefMailSendReadReceipts>;
3524
3542
  zimbraPrefMailToasterEnabled?: Maybe<Scalars['Boolean']['output']>;
3525
3543
  zimbraPrefMailTrustedSenderList?: Maybe<Array<Maybe<Scalars['String']['output']>>>;
3544
+ zimbraPrefMandatorySpellCheckEnabled?: Maybe<Scalars['Boolean']['output']>;
3526
3545
  zimbraPrefMarkMsgRead?: Maybe<Scalars['Int']['output']>;
3527
3546
  zimbraPrefMessageViewHtmlPreferred?: Maybe<Scalars['Boolean']['output']>;
3528
3547
  zimbraPrefOutOfOfficeExternalReply?: Maybe<Scalars['String']['output']>;
@@ -3596,6 +3615,7 @@ export type PreferencesInput = {
3596
3615
  zimbraPrefMailSendReadReceipts?: InputMaybe<PrefMailSendReadReceipts>;
3597
3616
  zimbraPrefMailToasterEnabled?: InputMaybe<Scalars['Boolean']['input']>;
3598
3617
  zimbraPrefMailTrustedSenderList?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
3618
+ zimbraPrefMandatorySpellCheckEnabled?: InputMaybe<Scalars['Boolean']['input']>;
3599
3619
  zimbraPrefMarkMsgRead?: InputMaybe<Scalars['Int']['input']>;
3600
3620
  zimbraPrefMessageViewHtmlPreferred?: InputMaybe<Scalars['Boolean']['input']>;
3601
3621
  zimbraPrefOutOfOfficeExternalReply?: InputMaybe<Scalars['String']['input']>;
@@ -3660,6 +3680,7 @@ export type Query = {
3660
3680
  accountInfo?: Maybe<AccountInfo>;
3661
3681
  autoComplete?: Maybe<AutoCompleteResponse>;
3662
3682
  autoCompleteGAL?: Maybe<AutoCompleteGalResponse>;
3683
+ checkSpelling?: Maybe<CheckSpellingResponse>;
3663
3684
  clientInfo?: Maybe<ClientInfoType>;
3664
3685
  discoverRights?: Maybe<DiscoverRights>;
3665
3686
  downloadAttachment?: Maybe<Attachment>;
@@ -3731,6 +3752,12 @@ export type QueryAutoCompleteGalArgs = {
3731
3752
  };
3732
3753
 
3733
3754
 
3755
+ export type QueryCheckSpellingArgs = {
3756
+ ignore?: InputMaybe<Array<InputMaybe<Scalars['String']['input']>>>;
3757
+ text: Scalars['String']['input'];
3758
+ };
3759
+
3760
+
3734
3761
  export type QueryClientInfoArgs = {
3735
3762
  by?: InputMaybe<Scalars['String']['input']>;
3736
3763
  domain?: InputMaybe<Scalars['String']['input']>;
@@ -1670,6 +1670,7 @@ type Preferences {
1670
1670
  zimbraPrefComposeDirection: String
1671
1671
  zimbraPrefComposeFormat: Mode
1672
1672
  zimbraPrefForwardReplyInOriginalFormat: Boolean
1673
+ zimbraPrefMandatorySpellCheckEnabled: Boolean
1673
1674
  zimbraPrefHtmlEditorDefaultFontColor: String
1674
1675
  zimbraPrefHtmlEditorDefaultFontFamily: String
1675
1676
  zimbraPrefHtmlEditorDefaultFontSize: String
@@ -2764,6 +2765,7 @@ input PreferencesInput {
2764
2765
  zimbraPrefComposeDirection: String
2765
2766
  zimbraPrefComposeFormat: Mode
2766
2767
  zimbraPrefForwardReplyInOriginalFormat: Boolean
2768
+ zimbraPrefMandatorySpellCheckEnabled: Boolean
2767
2769
  zimbraPrefExternalSendersType: ExternalSendersType
2768
2770
  zimbraPrefHtmlEditorDefaultFontColor: String
2769
2771
  zimbraPrefHtmlEditorDefaultFontFamily: String
@@ -3531,6 +3533,16 @@ input DiscoverRightInput {
3531
3533
  _content: String
3532
3534
  }
3533
3535
 
3536
+ type Misspelling {
3537
+ word: String
3538
+ suggestions: [String]
3539
+ }
3540
+
3541
+ type CheckSpellingResponse {
3542
+ available: Boolean
3543
+ misspelled: [Misspelling]
3544
+ }
3545
+
3534
3546
  # Zimbra GraphQL Queries
3535
3547
  # - [[SOAP API Reference]](https://files.zimbra.com/docs/soap_api/8.7.11/api-reference/index.html)
3536
3548
  # - [[SOAP Documentation]](https://github.com/Zimbra/zm-mailbox/blob/develop/store/docs/soap.txt)
@@ -3724,6 +3736,11 @@ type Query {
3724
3736
  taskFolders: [Folder]
3725
3737
 
3726
3738
  getTag: [Tag]
3739
+
3740
+ checkSpelling(
3741
+ text: String!
3742
+ ignore: [String]
3743
+ ): CheckSpellingResponse
3727
3744
  }
3728
3745
 
3729
3746
  type Mutation {
@@ -3937,6 +3954,7 @@ type Mutation {
3937
3954
  subscribeDistributionList(op: String!, by: String, dl: String!): String
3938
3955
  distributionListAction(dlActions: DistributionListActionInput!): Boolean
3939
3956
  bounceMessage(message: RedirectMessgeInput): Boolean
3957
+ addToSpellCheckDictionary(word: String): Boolean
3940
3958
  }
3941
3959
 
3942
3960
  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
  });