@zimbra/api-client 77.0.0 → 79.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.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zimbra/api-client",
3
3
  "amdName": "zmApiJsClient",
4
- "version": "77.0.0",
4
+ "version": "79.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",
@@ -14,7 +14,6 @@
14
14
  "lint:fix": "npm run lint -- --fix",
15
15
  "test:unit": "BABEL_ENV=test mocha --require ./babelRegisterConfig.js test/**/*.js",
16
16
  "test:watch": "npm run test:unit -- --watch",
17
- "test:no-synacor-npm-refs": "node ./scripts/synacor-npm-refs.js",
18
17
  "clean": "rimraf dist",
19
18
  "build": "npm-run-all clean generateSchemaTypes rollup:* -p build:ts minify:* copySchema",
20
19
  "build:ts": "tsc --emitDeclarationOnly --declaration --outDir \"dist\"",
@@ -45,50 +44,49 @@
45
44
  },
46
45
  "dependencies": {
47
46
  "@apollo/client": "^3.4.16",
48
- "dataloader": "^2.0.0",
49
- "graphql": "^15.6.1",
50
- "graphql-tools": "^8.2.0",
47
+ "dataloader": "^2.1.0",
48
+ "graphql": "^15.8.0",
49
+ "graphql-tools": "^8.2.9",
51
50
  "lodash": "^4.17.21",
52
51
  "mitt": "^3.0.0"
53
52
  },
54
53
  "devDependencies": {
55
- "@babel/cli": "^7.15.7",
56
- "@babel/core": "^7.15.8",
57
- "@babel/plugin-proposal-class-properties": "^7.14.5",
58
- "@babel/preset-env": "^7.15.8",
59
- "@babel/preset-typescript": "^7.15.0",
60
- "@babel/register": "^7.15.3",
61
- "@graphql-codegen/cli": "^2.2.0",
62
- "@graphql-codegen/typescript": "^2.2.2",
63
- "@rollup/plugin-babel": "^5.3.0",
64
- "@rollup/plugin-commonjs": "^21.0.0",
65
- "@rollup/plugin-node-resolve": "^13.0.5",
66
- "@rollup/plugin-typescript": "^8.2.5",
54
+ "@babel/cli": "^7.17.10",
55
+ "@babel/core": "^7.17.10",
56
+ "@babel/plugin-proposal-class-properties": "^7.16.7",
57
+ "@babel/preset-env": "^7.17.10",
58
+ "@babel/preset-typescript": "^7.16.7",
59
+ "@babel/register": "^7.17.7",
60
+ "@graphql-codegen/cli": "^2.6.2",
61
+ "@graphql-codegen/typescript": "^2.4.11",
62
+ "@rollup/plugin-babel": "^5.3.1",
63
+ "@rollup/plugin-commonjs": "^22.0.0",
64
+ "@rollup/plugin-node-resolve": "^13.3.0",
65
+ "@rollup/plugin-typescript": "^8.3.2",
67
66
  "@types/graphql": "^14.5.0",
68
- "@types/lodash": "^4.14.178",
69
- "@types/node": "^17.0.8",
67
+ "@types/lodash": "^4.14.182",
68
+ "@types/node": "^17.0.32",
70
69
  "@types/whatwg-fetch": "^0.0.33",
71
- "audit-ci": "^4.1.0",
70
+ "audit-ci": "^6.2.0",
72
71
  "babel-plugin-lodash": "^3.3.4",
73
- "chai": "^4.3.4",
72
+ "chai": "^4.3.6",
74
73
  "copyfiles": "^2.4.1",
75
74
  "cross-var": "^1.1.0",
76
- "file-matcher": "^1.3.0",
77
- "husky": "^7.0.4",
78
- "is-ci": "^3.0.0",
79
- "lint-staged": "^12.1.7",
80
- "mocha": "^9.1.2",
75
+ "husky": "^8.0.1",
76
+ "is-ci": "^3.0.1",
77
+ "lint-staged": "^12.4.1",
78
+ "mocha": "^10.0.0",
81
79
  "npm-run-all": "^4.1.5",
82
- "prettier": "^2.5.1",
80
+ "prettier": "^2.6.2",
83
81
  "rimraf": "^3.0.2",
84
- "rollup": "^2.58.0",
82
+ "rollup": "^2.72.1",
85
83
  "rollup-plugin-graphql": "^0.1.0",
86
84
  "rollup-plugin-local-resolve": "^1.0.7",
87
- "tslib": "^2.3.1",
85
+ "tslib": "^2.4.0",
88
86
  "tslint": "^6.1.3",
89
87
  "tslint-config-prettier": "^1.18.0",
90
88
  "tslint-plugin-prettier": "^2.3.0",
91
- "typescript": "^4.5.4",
92
- "uglify-js": "^3.14.2"
89
+ "typescript": "^4.6.4",
90
+ "uglify-js": "^3.15.5"
93
91
  }
94
92
  }
@@ -1,4 +1,4 @@
1
- import { ApolloLink, FetchResult, Observable, Operation } from '@apollo/client';
1
+ import { ApolloLink, FetchResult, Observable, Operation } from '@apollo/client/core';
2
2
  import { BatchLink } from '@apollo/client/link/batch';
3
3
  import { graphql, print } from 'graphql';
4
4
  import events from 'mitt';
@@ -1,4 +1,11 @@
1
- import { ApolloLink, FetchResult, NextLink, Observable, Observer, Operation } from '@apollo/client';
1
+ import {
2
+ ApolloLink,
3
+ FetchResult,
4
+ NextLink,
5
+ Observable,
6
+ Observer,
7
+ Operation
8
+ } from '@apollo/client/core';
2
9
 
3
10
  import { SyncOfflineOperations } from '../sync-offline-operations';
4
11
  import { OfflineQueueLinkOptions, OperationEntry, StorageProvider } from './types';
@@ -1,5 +1,4 @@
1
- import { FetchResult, NextLink, Operation } from '@apollo/client';
2
- import { Observer } from '@apollo/client';
1
+ import { FetchResult, NextLink, Observer, Operation } from '@apollo/client/core';
3
2
 
4
3
  export interface OfflineQueueLinkOptions {
5
4
  isOpen?: boolean;
@@ -1,4 +1,4 @@
1
- import { Operation } from '@apollo/client';
1
+ import { Operation } from '@apollo/client/core';
2
2
  import get from 'lodash/get';
3
3
  import { OfflineOperationEntry, OperationEntry } from './types';
4
4
 
@@ -1,4 +1,4 @@
1
- import { defaultDataIdFromObject, InMemoryCache, InMemoryCacheConfig } from '@apollo/client';
1
+ import { defaultDataIdFromObject, InMemoryCache, InMemoryCacheConfig } from '@apollo/client/core';
2
2
  import get from 'lodash/get';
3
3
 
4
4
  const dataIdFromPath = (result: any, path: string) => {
@@ -541,7 +541,7 @@ export class ZimbraBatchClient {
541
541
  },
542
542
  singleRequest: true,
543
543
  namespace: Namespace.Account
544
- }).then(res => normalize(ClientInfoResponse)(res));
544
+ }).then(res => normalize(ClientInfoResponse)(mapValuesDeep(res, coerceStringToBoolean)));
545
545
 
546
546
  public contactAction = (options: ActionOptions) => this.action(ActionType.contact, options);
547
547
 
@@ -682,8 +682,7 @@ export class ZimbraBatchClient {
682
682
  this.jsonRequest({
683
683
  name: 'CreateSignature',
684
684
  namespace: Namespace.Account,
685
- body: denormalize(CreateSignatureRequest)(options),
686
- singleRequest: true
685
+ body: denormalize(CreateSignatureRequest)(options)
687
686
  });
688
687
 
689
688
  public createTag = (tag: CreateTagInput) =>
@@ -850,6 +849,41 @@ export class ZimbraBatchClient {
850
849
  singleRequest: true
851
850
  });
852
851
 
852
+ public endSessionBeaconRequest = (options: JsonRequestOptions) => {
853
+ const body = {
854
+ Body: {
855
+ EndSessionRequest: {
856
+ _jsns: Namespace.Account
857
+ }
858
+ },
859
+ Header: {
860
+ context: {
861
+ _jsns: Namespace.All,
862
+ csrfToken: this.csrfToken,
863
+ account: {
864
+ by: 'name',
865
+ _content: options.accountName
866
+ },
867
+ session: {
868
+ id: this.sessionId,
869
+ _content: this.sessionId
870
+ },
871
+ userAgent: this.userAgent
872
+ }
873
+ }
874
+ };
875
+
876
+ try {
877
+ const blob = new Blob([JSON.stringify(body)]);
878
+ if (navigator) {
879
+ // In zimbra desktop client navigator is null
880
+ navigator.sendBeacon(`${this.origin}/service/soap`, blob);
881
+ }
882
+ } catch (e) {
883
+ throw new Error('Error on endSessionBeaconRequest request' + e);
884
+ }
885
+ };
886
+
853
887
  public folderAction = (options: ActionOptions) => this.action(ActionType.folder, options);
854
888
 
855
889
  public forwardAppointment = (body: ForwardAppointmentInput) =>
@@ -1594,7 +1628,7 @@ export class ZimbraBatchClient {
1594
1628
  cancelResetPassword
1595
1629
  },
1596
1630
  singleRequest: true
1597
- });
1631
+ }).then(res => mapValuesDeep(res, coerceStringToBoolean));
1598
1632
 
1599
1633
  public resolve = (path: string) => `${this.origin}${path}`;
1600
1634