Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package-upgrades Upgrade remaining packages after last upgrade #427

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: 2.1
config: &config
working_directory: ~/repo
docker:
- image: cimg/node:lts
- image: cimg/node:14.18

persist-workspace: &persist-workspace
persist_to_workspace:
Expand Down
25,590 changes: 11,415 additions & 14,175 deletions package-lock.json

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@zimbra/api-client",
"amdName": "zmApiJsClient",
"version": "67.0.0",
"version": "69.0.0",
"description": "Zimbra JS API Client and GraphQL client for making requests against the Zimbra SOAP API.",
"main": "dist/zm-api-js-client.js",
"source": "index.ts",
Expand Down Expand Up @@ -44,51 +44,51 @@
]
},
"dependencies": {
"@apollo/client": "^3.2.1",
"dataloader": "^1.4.0",
"graphql": "^15.3.0",
"graphql-tools": "^7.0.4",
"@apollo/client": "^3.5.8",
"dataloader": "^2.0.0",
"graphql": "^15.8.0",
"graphql-tools": "^8.2.0",
"lodash": "^4.17.21",
"mitt": "^2.1.0"
"mitt": "^3.0.0"
},
"devDependencies": {
"@babel/cli": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.12.1",
"@babel/preset-typescript": "^7.12.1",
"@babel/register": "^7.12.1",
"@graphql-codegen/cli": "^1.21.4",
"@graphql-codegen/typescript": "^1.22.0",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^15.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-typescript": "^6.0.0",
"@babel/cli": "^7.17.0",
"@babel/core": "^7.17.2",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@babel/register": "^7.17.0",
"@graphql-codegen/cli": "^2.5.0",
"@graphql-codegen/typescript": "^2.4.3",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-typescript": "^8.3.0",
"@types/graphql": "^14.5.0",
"@types/lodash": "^4.14.162",
"@types/node": "^14.14.2",
"@types/lodash": "^4.14.178",
"@types/node": "^17.0.16",
"@types/whatwg-fetch": "^0.0.33",
"audit-ci": "^4.1.0",
"audit-ci": "^5.1.2",
"babel-plugin-lodash": "^3.3.4",
"chai": "^4.2.0",
"chai": "^4.3.6",
"copyfiles": "^2.4.1",
"cross-var": "^1.1.0",
"file-matcher": "^1.3.0",
"husky": "^6.0.0",
"is-ci": "^3.0.0",
"lint-staged": "^11.1.1",
"mocha": "^8.3.2",
"husky": "^7.0.4",
"is-ci": "^3.0.1",
"lint-staged": "^12.3.3",
"mocha": "^9.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.3.1",
"prettier": "^2.5.1",
"rimraf": "^3.0.2",
"rollup": "^2.32.1",
"rollup": "^2.67.1",
"rollup-plugin-graphql": "^0.1.0",
"rollup-plugin-local-resolve": "^1.0.7",
"tslib": "^2.0.3",
"tslib": "^2.3.1",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.3.0",
"typescript": "^4.0.3",
"uglify-js": "^3.12.1"
"typescript": "^4.5.5",
"uglify-js": "^3.15.1"
}
}
2 changes: 1 addition & 1 deletion src/apollo/offline-queue-link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class OfflineQueueLink extends ApolloLink {
// Returns a Promise that resolves after all operations are processed
// regardless of success.
retry = () =>
new Promise(resolve => {
new Promise<void>(resolve => {
let outstandingReqs = this.operationQueue.length;
if (!outstandingReqs) {
return resolve();
Expand Down
38 changes: 38 additions & 0 deletions src/apollo/zimbra-in-memory-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ const dataIdFromObject = (object: any) => {
case 'ContactListMember':
// Contacts list members don't have ids
return `${object.type}:${object.value}`;
case 'MessageInfo':
if (object.part && object.part !== null) {
return `${defaultDataIdFromObject(object)}:${object.part}`;
}
return defaultDataIdFromObject(object);
default:
return defaultDataIdFromObject(object);
}
Expand All @@ -55,6 +60,39 @@ const typePolicies = {
merge: true
}
}
},
Contact: {
fields: {
attributes: {
merge: true
}
}
},
Conversation: {
fields: {
messages: {
// @TODO ideally we should write proper merge function here,
// but as our app is already handling at caller level
// we are just overwriting cache data here
merge: false
},
emailAddresses: {
// @TODO ideally we should write proper merge function here,
// but as our app is already handling at caller level
// we are just overwriting cache data here
merge: false
}
}
},
MessageInfo: {
fields: {
emailAddresses: {
// @TODO ideally we should write proper merge function here,
// but as our app is already handling at caller level
// we are just overwriting cache data here
merge: false
}
}
}
};

Expand Down
25 changes: 20 additions & 5 deletions src/batch-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,20 @@ export class ZimbraBatchClient {

if (folders.folders) {
folders.folders = folders.folders.map(setUnreadDescendentFlag);

folders.folders = folders.folders.map((currentFolder: any) => {
if (currentFolder.linkedFolders) {
currentFolder.linkedFolders = currentFolder.linkedFolders.map((linkFolder: any) => {
const { absFolderPath, oname, folders } = linkFolder;

if (oname && folders) {
linkFolder.folders = updateAbsoluteFolderPath(oname, absFolderPath, folders);
}
return linkFolder;
});
}
return currentFolder;
});
}
if (folders.linkedFolders) {
folders.linkedFolders = folders.linkedFolders.map(setUnreadDescendentFlag);
Expand Down Expand Up @@ -1129,7 +1143,7 @@ export class ZimbraBatchClient {
return mapValuesDeep(res, coerceStringToBoolean);
});

public getMessage = ({ id, html, raw, header, read, max, ridZ }: GetMessageOptions) =>
public getMessage = ({ id, html, raw, header, read, max, ridZ, part }: GetMessageOptions) =>
this.jsonRequest({
name: 'GetMsg',
body: {
Expand All @@ -1144,7 +1158,8 @@ export class ZimbraBatchClient {
// max body length (look for mp.truncated=1)
max: max || 250000,
raw: raw ? 1 : 0,
...(ridZ && { ridZ: ridZ })
...(ridZ && { ridZ: ridZ }),
...(part && { part: part })
}
}
}).then(res => (res && res.m ? this.normalizeMessage(res.m[0]) : null));
Expand Down Expand Up @@ -1306,7 +1321,7 @@ export class ZimbraBatchClient {
password,
recoveryCode,
tokenType,
persistAuthTokenCookie = true,
persistAuthTokenCookie,
twoFactorCode,
deviceTrusted,
csrfTokenSecured
Expand Down Expand Up @@ -1800,7 +1815,7 @@ export class ZimbraBatchClient {
});
};

private batchDataHandler = (requests: Array<RequestOptions>) =>
private batchDataHandler = (requests: ReadonlyArray<RequestOptions>) =>
batchJsonRequest({
requests,
...this.getAdditionalRequestOptions()
Expand Down Expand Up @@ -1837,7 +1852,7 @@ export class ZimbraBatchClient {
}
};

private dataHandler = (requests: Array<JsonRequestOptions>) =>
private dataHandler = (requests: ReadonlyArray<JsonRequestOptions>) =>
jsonRequest({
...requests[0],
// check if login request then don't add csrfToken
Expand Down
4 changes: 3 additions & 1 deletion src/normalize/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const CalendarItemOrganizer = new Entity({

const commonFieldForMessageAndDocuments = {
d: 'date',
sd: 'senderDate',
f: 'flags',
l: 'folderId',
md: 'changeDate',
Expand All @@ -112,7 +113,8 @@ const commonFieldForMessageAndDocuments = {
s: 'size',
sf: 'sortField',
t: 'tags',
tn: 'tagNames'
tn: 'tagNames',
part: 'part'
};

const commonMessageFields = {
Expand Down
4 changes: 2 additions & 2 deletions src/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function _responseParseHandler(response: Response): Promise<ParsedResponse> {
return response;
});
} catch (e) {
(response as ParsedResponse).parseError = e;
(response as ParsedResponse).parseError = <any>e;
return Promise.resolve(response);
}
}
Expand Down Expand Up @@ -97,7 +97,7 @@ function faultError(response: ParsedResponse, faults: any) {
* Create one key per SOAP command name, with a value
* containing an array of the requests for that command.
*/
function batchBody(requests: Array<RequestOptions>) {
function batchBody(requests: ReadonlyArray<RequestOptions>) {
return reduce(
requests,
(body: { [key: string]: any }, request) => {
Expand Down
2 changes: 1 addition & 1 deletion src/request/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface RequestOptions {
export interface JsonRequestOptions extends BaseRequestOptions, RequestOptions {}

export interface BatchRequestOptions extends BaseRequestOptions {
requests: Array<RequestOptions>;
requests: ReadonlyArray<RequestOptions>;
}

export interface RequestResponse {
Expand Down
Loading