@zimbra/api-client 93.0.0 → 94.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-lock.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zimbra/api-client",
3
- "version": "93.0.0",
3
+ "version": "94.0.0",
4
4
  "lockfileVersion": 1,
5
5
  "requires": true,
6
6
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zimbra/api-client",
3
3
  "amdName": "zmApiJsClient",
4
- "version": "93.0.0",
4
+ "version": "94.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",
@@ -530,22 +530,44 @@ export class ZimbraBatchClient {
530
530
  loginNewPassword,
531
531
  password,
532
532
  username,
533
- dryRun = false
534
- }: ChangePasswordOptions) =>
535
- this.jsonRequest({
536
- name: 'ChangePassword',
537
- namespace: Namespace.Account,
538
- body: {
539
- account: {
540
- by: 'name',
541
- _content: username
533
+ dryRun = false,
534
+ authToken,
535
+ csrfToken
536
+ }: ChangePasswordOptions) => {
537
+ if (authToken) {
538
+ return this.jsonRequest({
539
+ name: 'ChangePassword',
540
+ namespace: Namespace.Account,
541
+ body: {
542
+ account: {
543
+ by: 'name',
544
+ _content: username
545
+ },
546
+ oldPassword: password,
547
+ password: loginNewPassword,
548
+ dryRun,
549
+ authToken: { _content: authToken },
550
+ csrfToken: { _content: csrfToken }
542
551
  },
543
- oldPassword: password,
544
- password: loginNewPassword,
545
- dryRun
546
- },
547
- singleRequest: true
548
- });
552
+ singleRequest: true
553
+ });
554
+ } else {
555
+ return this.jsonRequest({
556
+ name: 'ChangePassword',
557
+ namespace: Namespace.Account,
558
+ body: {
559
+ account: {
560
+ by: 'name',
561
+ _content: username
562
+ },
563
+ oldPassword: password,
564
+ password: loginNewPassword,
565
+ dryRun
566
+ },
567
+ singleRequest: true
568
+ });
569
+ }
570
+ };
549
571
 
550
572
  public checkCalendar = ({ id, value }: FolderActionCheckCalendarInput) =>
551
573
  this.action(ActionType.folder, {
@@ -860,8 +882,7 @@ export class ZimbraBatchClient {
860
882
  password,
861
883
  authToken,
862
884
  twoFactorCode,
863
- csrfTokenSecured,
864
- ignoreSameSite
885
+ csrfTokenSecured
865
886
  }: EnableTwoFactorAuthInput) =>
866
887
  this.jsonRequest({
867
888
  name: 'EnableTwoFactorAuth',
@@ -894,7 +915,6 @@ export class ZimbraBatchClient {
894
915
  _content: twoFactorCode
895
916
  }
896
917
  }),
897
- ...(ignoreSameSite && { ignoreSameSite }),
898
918
  csrfTokenSecured
899
919
  },
900
920
  namespace: Namespace.Account,
@@ -1462,14 +1482,10 @@ export class ZimbraBatchClient {
1462
1482
  const versionIds = data.documents.map((doc: any) => doc.version);
1463
1483
  const maxVersion = Math.max(...versionIds);
1464
1484
  const latestDocumentVersion = data.documents.find((doc: any) => doc.version === maxVersion);
1465
- const versionDocuments = data.documents.map((versionDoc: any) => ({
1466
- ...versionDoc,
1467
- name: latestDocumentVersion.name
1468
- }));
1469
1485
 
1470
1486
  return {
1471
1487
  ...latestDocumentVersion,
1472
- docs: versionDocuments
1488
+ docs: data.documents
1473
1489
  };
1474
1490
  });
1475
1491
 
@@ -1481,8 +1497,7 @@ export class ZimbraBatchClient {
1481
1497
  persistAuthTokenCookie,
1482
1498
  twoFactorCode,
1483
1499
  deviceTrusted,
1484
- csrfTokenSecured,
1485
- ignoreSameSite
1500
+ csrfTokenSecured
1486
1501
  }: LoginOptions) =>
1487
1502
  this.jsonRequest({
1488
1503
  name: 'Auth',
@@ -1495,7 +1510,6 @@ export class ZimbraBatchClient {
1495
1510
  by: 'name',
1496
1511
  _content: username
1497
1512
  },
1498
- ...(ignoreSameSite && { ignoreSameSite }),
1499
1513
  ...(password && { password }),
1500
1514
  ...(recoveryCode && {
1501
1515
  recoveryCode: {
@@ -231,6 +231,8 @@ export interface ShareInfoOptions {
231
231
  }
232
232
 
233
233
  export interface ChangePasswordOptions {
234
+ authToken: string;
235
+ csrfToken: string;
234
236
  dryRun: boolean;
235
237
  loginNewPassword: string;
236
238
  password: string;
@@ -245,7 +247,6 @@ export interface ModifyProfileImageOptions {
245
247
  export interface LoginOptions {
246
248
  csrfTokenSecured: boolean;
247
249
  deviceTrusted?: boolean;
248
- ignoreSameSite?: boolean;
249
250
  password: string;
250
251
  persistAuthTokenCookie?: boolean;
251
252
  recoveryCode?: string;
@@ -384,6 +384,7 @@ export type AuthResponse = {
384
384
  authToken?: Maybe<Array<Maybe<AuthToken>>>;
385
385
  csrfToken?: Maybe<CsrfToken>;
386
386
  lifetime?: Maybe<Scalars['Float']['output']>;
387
+ resetPassword?: Maybe<ResetPassword>;
387
388
  session?: Maybe<Session>;
388
389
  skin?: Maybe<Array<Maybe<Skin>>>;
389
390
  trustedDevicesEnabled?: Maybe<TrustedDevicesEnabled>;
@@ -1534,7 +1535,6 @@ export type EnableTwoFactorAuthInput = {
1534
1535
  authToken?: InputMaybe<Scalars['String']['input']>;
1535
1536
  csrfTokenSecured: Scalars['Boolean']['input'];
1536
1537
  email?: InputMaybe<Scalars['String']['input']>;
1537
- ignoreSameSite?: InputMaybe<Scalars['Boolean']['input']>;
1538
1538
  method: Scalars['String']['input'];
1539
1539
  name: Scalars['String']['input'];
1540
1540
  password?: InputMaybe<Scalars['String']['input']>;
@@ -2803,6 +2803,8 @@ export type MutationChangeFolderColorArgs = {
2803
2803
 
2804
2804
 
2805
2805
  export type MutationChangePasswordArgs = {
2806
+ authToken?: InputMaybe<Scalars['String']['input']>;
2807
+ csrfToken?: InputMaybe<Scalars['String']['input']>;
2806
2808
  dryRun?: InputMaybe<Scalars['Boolean']['input']>;
2807
2809
  loginNewPassword: Scalars['String']['input'];
2808
2810
  password: Scalars['String']['input'];
@@ -3017,7 +3019,6 @@ export type MutationItemActionArgs = {
3017
3019
  export type MutationLoginArgs = {
3018
3020
  csrfTokenSecured: Scalars['Boolean']['input'];
3019
3021
  deviceTrusted?: InputMaybe<Scalars['Boolean']['input']>;
3020
- ignoreSameSite?: InputMaybe<Scalars['Boolean']['input']>;
3021
3022
  password?: InputMaybe<Scalars['String']['input']>;
3022
3023
  persistAuthTokenCookie?: InputMaybe<Scalars['Boolean']['input']>;
3023
3024
  recoveryCode?: InputMaybe<Scalars['String']['input']>;
@@ -4046,6 +4047,11 @@ export type ReplyActionInput = {
4046
4047
  index?: InputMaybe<Scalars['Int']['input']>;
4047
4048
  };
4048
4049
 
4050
+ export type ResetPassword = {
4051
+ __typename?: 'ResetPassword';
4052
+ _content?: Maybe<Scalars['Boolean']['output']>;
4053
+ };
4054
+
4049
4055
  export type ResetPasswordResponse = {
4050
4056
  __typename?: 'ResetPasswordResponse';
4051
4057
  attrs?: Maybe<ResetPasswordResponseAttributes>;
@@ -343,6 +343,7 @@ type AuthResponse {
343
343
  session: Session
344
344
  skin: [Skin]
345
345
  csrfToken: CsrfToken
346
+ resetPassword: ResetPassword
346
347
  }
347
348
 
348
349
  type ScratchCodeType {
@@ -388,6 +389,10 @@ type TrustedDevicesEnabled {
388
389
  _content: Boolean
389
390
  }
390
391
 
392
+ type ResetPassword {
393
+ _content: Boolean
394
+ }
395
+
391
396
  type Session {
392
397
  id: ID
393
398
  _content: String
@@ -3089,7 +3094,6 @@ input EnableTwoFactorAuthInput {
3089
3094
  twoFactorCode: String
3090
3095
  authToken: String
3091
3096
  csrfTokenSecured: Boolean!
3092
- ignoreSameSite: Boolean
3093
3097
  }
3094
3098
 
3095
3099
  input SendTwoFactorAuthCodeInput {
@@ -3685,6 +3689,8 @@ type Mutation {
3685
3689
  loginNewPassword: String!
3686
3690
  password: String!
3687
3691
  username: String!
3692
+ authToken: String
3693
+ csrfToken: String
3688
3694
  ): AuthResponse
3689
3695
  modifyProfileImage(
3690
3696
  content: String
@@ -3771,7 +3777,6 @@ type Mutation {
3771
3777
  twoFactorCode: String
3772
3778
  deviceTrusted: Boolean
3773
3779
  csrfTokenSecured: Boolean!
3774
- ignoreSameSite: Boolean
3775
3780
  ): AuthResponse
3776
3781
  enableTwoFactorAuth(
3777
3782
  options: EnableTwoFactorAuthInput!