From 2ef81a1e8e98b56a350f8dc05923311901b970fd Mon Sep 17 00:00:00 2001 From: Frederic Beaudoin Date: Fri, 21 Jun 2024 08:09:19 -0400 Subject: [PATCH] fix(cli): org:search:dump issues when dump is fetched across multiple queries (#1474) https://coveord.atlassian.net/browse/KIT-3321 --- package-lock.json | 155 ++++++++++++++++-- package.json | 2 +- packages/cli-e2e/package.json | 2 +- packages/cli/commons/package.json | 2 +- packages/cli/core/package.json | 2 +- .../core/src/commands/org/search/dump.spec.ts | 15 ++ .../cli/core/src/commands/org/search/dump.ts | 1 + packages/cli/source/package.json | 2 +- packages/ui/atomic/create-atomic/package.json | 2 +- .../create-headless-vue/template/package.json | 2 +- 10 files changed, 163 insertions(+), 22 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6505c4fab0..62f74cea02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "@actions/github": "5.1.1", "@commitlint/config-conventional": "17.6.1", "@commitlint/lint": "17.6.1", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "@coveo/semantic-monorepo-tools": "2.4.28", "@coveord/release": "1.0.0", "@npmcli/arborist": "6.2.8", @@ -2711,13 +2711,24 @@ "integrity": "sha512-7jiRWgN4/8IdvCxbIwnwg2W0bbYFBH6BxFqBjMKk442t7+liF2Z1H6AUCcl8e/pD93GjPru+axeiJwFmRww1WQ==" }, "node_modules/@coveo/platform-client": { - "version": "52.1.0", - "resolved": "https://registry.npmjs.org/@coveo/platform-client/-/platform-client-52.1.0.tgz", - "integrity": "sha512-uLmfUvVYUfD7m4prTmC7ZgXnSXULqMq8gw2LCo/d+KiYU3tuHkdZsiienttLGjFrbcUw05AiNiMaZOzi5Va4lA==", + "version": "54.9.3", + "resolved": "https://registry.npmjs.org/@coveo/platform-client/-/platform-client-54.9.3.tgz", + "integrity": "sha512-cKt1VyVSAidCiRHtQ8kA9JCny3571J2jNbovA5vfHnnROxiHcDngHpwmRhdTtKNPckTvpbCgMnCfjU/YthaBxA==", "dependencies": { + "core-js": "^3.37.1", "exponential-backoff": "^3.1.0", "query-string-cjs": "npm:query-string@^7.0.0", - "query-string-esm": "npm:query-string@^8.0.0" + "query-string-esm": "npm:query-string@^9.0.0" + } + }, + "node_modules/@coveo/platform-client/node_modules/core-js": { + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", + "integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==", + "hasInstallScript": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" } }, "node_modules/@coveo/process-helpers": { @@ -2749,6 +2760,63 @@ "resolved": "https://registry.npmjs.org/@coveo/bueno/-/bueno-0.45.6.tgz", "integrity": "sha512-OPYN3pqw6ON7X1EYbCxRWcGBt9gjeOHDj9VVnL8YtD/nzozphTw2nYV9yf7OxfgUOYCiV2IvSXLHSA+tftQW2Q==" }, + "node_modules/@coveo/push-api-client/node_modules/@coveo/platform-client": { + "version": "52.6.1", + "resolved": "https://registry.npmjs.org/@coveo/platform-client/-/platform-client-52.6.1.tgz", + "integrity": "sha512-AyuoypQalnqQQMaqc7P2TgjWGCxHGAqU1NSh7UQNdFaqqjxg3ZEe2qo1hTcAB4atONcMlpijLf1OLyzkY3fdpA==", + "dependencies": { + "exponential-backoff": "^3.1.0", + "query-string-cjs": "npm:query-string@^7.0.0", + "query-string-esm": "npm:query-string@^8.0.0" + } + }, + "node_modules/@coveo/push-api-client/node_modules/decode-uri-component": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz", + "integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==", + "engines": { + "node": ">=14.16" + } + }, + "node_modules/@coveo/push-api-client/node_modules/filter-obj": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", + "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@coveo/push-api-client/node_modules/query-string-esm": { + "name": "query-string", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-8.2.0.tgz", + "integrity": "sha512-tUZIw8J0CawM5wyGBiDOAp7ObdRQh4uBor/fUR9ZjmbZVvw95OD9If4w3MQxr99rg0DJZ/9CIORcpEqU5hQG7g==", + "dependencies": { + "decode-uri-component": "^0.4.1", + "filter-obj": "^5.1.0", + "split-on-first": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@coveo/push-api-client/node_modules/split-on-first": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz", + "integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@coveo/relay": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/@coveo/relay/-/relay-0.7.4.tgz", @@ -24734,16 +24802,16 @@ }, "node_modules/query-string-esm": { "name": "query-string", - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/query-string/-/query-string-8.1.0.tgz", - "integrity": "sha512-BFQeWxJOZxZGix7y+SByG3F36dA0AbTy9o6pSmKFcFz7DAj0re9Frkty3saBn3nHo3D0oZJ/+rx3r8H8r8Jbpw==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-9.0.0.tgz", + "integrity": "sha512-4EWwcRGsO2H+yzq6ddHcVqkCQ2EFUSfDMEjF8ryp8ReymyZhIuaFRGLomeOQLkrzacMHoyky2HW0Qe30UbzkKw==", "dependencies": { "decode-uri-component": "^0.4.1", "filter-obj": "^5.1.0", "split-on-first": "^3.0.0" }, "engines": { - "node": ">=14.16" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -30410,7 +30478,7 @@ "@babel/preset-env": "7.21.5", "@babel/preset-typescript": "7.21.5", "@coveo/cli": "3.2.6", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "abortcontroller-polyfill": "1.7.5", "async-retry": "1.3.3", "babel-jest": "29.5.0", @@ -30457,7 +30525,7 @@ "dependencies": { "@amplitude/analytics-node": "^1.3.3", "@amplitude/analytics-types": "^2.1.2", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "@oclif/core": "1.24.0", "abortcontroller-polyfill": "1.7.5", "chalk": "4.1.2", @@ -30518,7 +30586,7 @@ "@amplitude/identify": "^1.9.0", "@coveo/cli-commons": "2.9.3", "@coveo/cli-plugin-source": "2.3.3", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "@oclif/core": "1.24.0", "@oclif/plugin-help": "5.1.23", "@oclif/plugin-plugins": "2.1.12", @@ -30621,7 +30689,7 @@ "license": "Apache-2.0", "dependencies": { "@coveo/cli-commons": "2.9.3", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "@coveo/push-api-client": "4.0.1", "@oclif/core": "1.24.0", "@oclif/plugin-help": "5.1.23", @@ -30687,7 +30755,7 @@ "version": "1.40.2", "license": "Apache-2.0", "dependencies": { - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "abortcontroller-polyfill": "1.7.5", "detect-indent": "7.0.1", "https-proxy-agent": "5.0.1", @@ -31542,6 +31610,63 @@ "ts-jest": "29.1.0" } }, + "packages/ui/search-token-server/node_modules/@coveo/platform-client": { + "version": "52.1.0", + "resolved": "https://registry.npmjs.org/@coveo/platform-client/-/platform-client-52.1.0.tgz", + "integrity": "sha512-uLmfUvVYUfD7m4prTmC7ZgXnSXULqMq8gw2LCo/d+KiYU3tuHkdZsiienttLGjFrbcUw05AiNiMaZOzi5Va4lA==", + "dependencies": { + "exponential-backoff": "^3.1.0", + "query-string-cjs": "npm:query-string@^7.0.0", + "query-string-esm": "npm:query-string@^8.0.0" + } + }, + "packages/ui/search-token-server/node_modules/decode-uri-component": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz", + "integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==", + "engines": { + "node": ">=14.16" + } + }, + "packages/ui/search-token-server/node_modules/filter-obj": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", + "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/ui/search-token-server/node_modules/query-string-esm": { + "name": "query-string", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-8.2.0.tgz", + "integrity": "sha512-tUZIw8J0CawM5wyGBiDOAp7ObdRQh4uBor/fUR9ZjmbZVvw95OD9If4w3MQxr99rg0DJZ/9CIORcpEqU5hQG7g==", + "dependencies": { + "decode-uri-component": "^0.4.1", + "filter-obj": "^5.1.0", + "split-on-first": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "packages/ui/search-token-server/node_modules/split-on-first": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz", + "integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "packages/ui/vue/create-headless-vue": { "name": "@coveo/create-headless-vue", "version": "1.4.0", @@ -31576,7 +31701,7 @@ "zod": "^3.19.1" }, "devDependencies": { - "@coveo/platform-client": "^52.1.0", + "@coveo/platform-client": "54.9.3", "@rushstack/eslint-patch": "^1.1.4", "@types/node": "18.16.3", "@vitejs/plugin-vue": "^4.0.0", diff --git a/package.json b/package.json index 82e4ecaf7d..1c61448d65 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@actions/github": "5.1.1", "@commitlint/config-conventional": "17.6.1", "@commitlint/lint": "17.6.1", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "@coveo/semantic-monorepo-tools": "2.4.28", "@coveord/release": "1.0.0", "@npmcli/arborist": "6.2.8", diff --git a/packages/cli-e2e/package.json b/packages/cli-e2e/package.json index a4099b7523..aea5f44fd7 100644 --- a/packages/cli-e2e/package.json +++ b/packages/cli-e2e/package.json @@ -62,7 +62,7 @@ "@babel/preset-env": "7.21.5", "@babel/preset-typescript": "7.21.5", "@coveo/cli": "3.2.6", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "abortcontroller-polyfill": "1.7.5", "async-retry": "1.3.3", "babel-jest": "29.5.0", diff --git a/packages/cli/commons/package.json b/packages/cli/commons/package.json index 797ffd186e..ce19ad5eab 100644 --- a/packages/cli/commons/package.json +++ b/packages/cli/commons/package.json @@ -26,7 +26,7 @@ "dependencies": { "@amplitude/analytics-node": "^1.3.3", "@amplitude/analytics-types": "^2.1.2", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "@oclif/core": "1.24.0", "abortcontroller-polyfill": "1.7.5", "chalk": "4.1.2", diff --git a/packages/cli/core/package.json b/packages/cli/core/package.json index 1004fdf2ef..6ca61734b3 100644 --- a/packages/cli/core/package.json +++ b/packages/cli/core/package.json @@ -11,7 +11,7 @@ "@amplitude/identify": "^1.9.0", "@coveo/cli-commons": "2.9.3", "@coveo/cli-plugin-source": "2.3.3", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "@oclif/core": "1.24.0", "@oclif/plugin-help": "5.1.23", "@oclif/plugin-plugins": "2.1.12", diff --git a/packages/cli/core/src/commands/org/search/dump.spec.ts b/packages/cli/core/src/commands/org/search/dump.spec.ts index ee506c0e3c..5046a5e005 100644 --- a/packages/cli/core/src/commands/org/search/dump.spec.ts +++ b/packages/cli/core/src/commands/org/search/dump.spec.ts @@ -76,6 +76,21 @@ describe('org:search:dump', () => { mockedSearch.mockReset(); }); + test + .do(() => { + mockReturnNumberOfResults(0); + }) + .stdout() + .stderr() + .command(['org:search:dump', '-s', 'the_source_1']) + .it('should pass maximumAge 0 as a search parameter', () => + expect(mockedSearch).toHaveBeenCalledWith( + expect.objectContaining({ + maximumAge: 0, + }) + ) + ); + test .do(() => { mockReturnNumberOfResults(0); diff --git a/packages/cli/core/src/commands/org/search/dump.ts b/packages/cli/core/src/commands/org/search/dump.ts index 0f646a278f..aeb8193a89 100644 --- a/packages/cli/core/src/commands/org/search/dump.ts +++ b/packages/cli/core/src/commands/org/search/dump.ts @@ -261,6 +261,7 @@ export default class Dump extends CLICommand { const results = (await params.client.search.query({ aq: this.getFilter(params, rowId), debug: true, + maximumAge: 0, organizationId: params.organizationId, numberOfResults: this.numberOfResultPerQuery, sortCriteria: '@rowid ascending', diff --git a/packages/cli/source/package.json b/packages/cli/source/package.json index 3987b66d95..933338f859 100644 --- a/packages/cli/source/package.json +++ b/packages/cli/source/package.json @@ -15,7 +15,7 @@ ], "dependencies": { "@coveo/cli-commons": "2.9.3", - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "@coveo/push-api-client": "4.0.1", "@oclif/core": "1.24.0", "@oclif/plugin-help": "5.1.23", diff --git a/packages/ui/atomic/create-atomic/package.json b/packages/ui/atomic/create-atomic/package.json index 444c1b2e2d..6d7bd3136e 100644 --- a/packages/ui/atomic/create-atomic/package.json +++ b/packages/ui/atomic/create-atomic/package.json @@ -30,7 +30,7 @@ "access": "public" }, "dependencies": { - "@coveo/platform-client": "52.1.0", + "@coveo/platform-client": "54.9.3", "abortcontroller-polyfill": "1.7.5", "detect-indent": "7.0.1", "https-proxy-agent": "5.0.1", diff --git a/packages/ui/vue/create-headless-vue/template/package.json b/packages/ui/vue/create-headless-vue/template/package.json index 5d7ebbc3ff..737b73dabc 100644 --- a/packages/ui/vue/create-headless-vue/template/package.json +++ b/packages/ui/vue/create-headless-vue/template/package.json @@ -21,7 +21,7 @@ "zod": "^3.19.1" }, "devDependencies": { - "@coveo/platform-client": "^52.1.0", + "@coveo/platform-client": "54.9.3", "@rushstack/eslint-patch": "^1.1.4", "@types/node": "18.16.3", "@vitejs/plugin-vue": "^4.0.0",