From ee028e76b6c4676e336eb96f6ec00a7b89bf744b Mon Sep 17 00:00:00 2001 From: Johannes Vogt Date: Fri, 22 Nov 2024 11:40:55 +0100 Subject: [PATCH 1/6] fix media server --- media/srv/media-service.cds | 1 + media/srv/media-service.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/media/srv/media-service.cds b/media/srv/media-service.cds index 09441897..811dd741 100644 --- a/media/srv/media-service.cds +++ b/media/srv/media-service.cds @@ -1,6 +1,7 @@ using { sap.capire.media as db } from '../db/data-model'; namespace sap.capire.media; +@path: '/media-server' service MediaServer { entity Media as projection on db.Media ; } diff --git a/media/srv/media-service.js b/media/srv/media-service.js index b656f03c..ed9d480c 100644 --- a/media/srv/media-service.js +++ b/media/srv/media-service.js @@ -10,7 +10,7 @@ module.exports = srv => { }) srv.on('UPDATE', 'Media', (req, next) => { - const url = req._.req.path + const url = req.path if (url.includes('content')) { const id = req.data.id const obj = mediaDB.get(id) @@ -32,7 +32,7 @@ module.exports = srv => { }) srv.on('READ', 'Media', (req, next) => { - const url = req._.req.path + const url = req.path if (url.includes('content')) { const id = req.data.id const mediaObj = mediaDB.get(id) From b1a13f2460e9b79ab32a59a30fe7a86427825e8c Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Mon, 25 Nov 2024 00:31:04 +0100 Subject: [PATCH 2/6] common as plugin --- common/cds-plugin.js | 1 + common/package.json | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 common/cds-plugin.js diff --git a/common/cds-plugin.js b/common/cds-plugin.js new file mode 100644 index 00000000..f69b9be3 --- /dev/null +++ b/common/cds-plugin.js @@ -0,0 +1 @@ +// dummy to auto-load the plugin \ No newline at end of file diff --git a/common/package.json b/common/package.json index 35e537aa..894a9824 100644 --- a/common/package.json +++ b/common/package.json @@ -4,5 +4,12 @@ "version": "1.0.0", "dependencies": { "@sap/cds": "*" + }, + "cds": { + "requires": { + "@capire/common/data": { + "model": "@capire/common" + } + } } } From b652150788751745934fe8d1ad43a462a7e783b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:58:42 +0100 Subject: [PATCH 3/6] Bump the development-dependencies group across 1 directory with 4 updates (#782) Bumps the development-dependencies group with 4 updates in the / directory: [@cap-js/cds-types](https://github.com/cap-js/cds-types), [@cap-js/sqlite](https://github.com/cap-js/cds-dbs), [axios](https://github.com/axios/axios) and [eslint](https://github.com/eslint/eslint). Updates `@cap-js/cds-types` from 0.7.0 to 0.8.0 - [Release notes](https://github.com/cap-js/cds-types/releases) - [Changelog](https://github.com/cap-js/cds-types/blob/main/CHANGELOG.md) - [Commits](https://github.com/cap-js/cds-types/compare/v0.7.0...v0.8.0) Updates `@cap-js/sqlite` from 1.7.5 to 1.7.7 - [Release notes](https://github.com/cap-js/cds-dbs/releases) - [Changelog](https://github.com/cap-js/cds-dbs/blob/main/release-please-config.json) - [Commits](https://github.com/cap-js/cds-dbs/compare/sqlite-v1.7.5...sqlite-v1.7.7) Updates `axios` from 1.7.7 to 1.7.8 - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](https://github.com/axios/axios/compare/v1.7.7...v1.7.8) Updates `eslint` from 9.14.0 to 9.16.0 - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v9.14.0...v9.16.0) --- updated-dependencies: - dependency-name: "@cap-js/cds-types" dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies - dependency-name: "@cap-js/sqlite" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: development-dependencies - dependency-name: axios dependency-type: direct:development update-type: version-update:semver-patch dependency-group: development-dependencies - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor dependency-group: development-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 108 +++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/package-lock.json b/package-lock.json index 709422b2..046e8fe6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -124,11 +124,12 @@ } }, "node_modules/@cap-js/cds-types": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cap-js/cds-types/-/cds-types-0.7.0.tgz", - "integrity": "sha512-zprkz3csN7z7v+0V78UlCfg2psm7Q3DJwvBjQB5BxVhlBcmuzoXn5EKKvzIXjflgWP1hUsDUhjVU5Hg9Quvq0g==", + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@cap-js/cds-types/-/cds-types-0.8.0.tgz", + "integrity": "sha512-iy+Rc4C6tnFuBwTIREcrFBVp0vKVN+iB5WoZFcBX7b5y7rUvK9Pz/5YHplacyQpwzxUc8Iv+CXG6LeWH/b7Qqw==", "dev": true, "hasInstallScript": true, + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@types/express": "^4.17.21" }, @@ -137,9 +138,9 @@ } }, "node_modules/@cap-js/db-service": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@cap-js/db-service/-/db-service-1.12.1.tgz", - "integrity": "sha512-0sIyXK/osLIywIVdGj8CSVjSqGh1tjqImU9NPeAIfUxAtx7lBbuhwZdNpolxw6YfmCyWeIogJEzh0Nb3LWF8tQ==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/@cap-js/db-service/-/db-service-1.16.0.tgz", + "integrity": "sha512-+64G3UZJypXtqWjdm5rDAIhrXkg3gnCOcOguolXmdThPpq0HKF8pVSo/lRSQRWvttYoCLOfEXgLdY8I9KueqmA==", "dev": true, "license": "SEE LICENSE", "dependencies": { @@ -150,12 +151,13 @@ } }, "node_modules/@cap-js/sqlite": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.7.5.tgz", - "integrity": "sha512-X8M83U5sL3eXjhxooGShR/jx4IhBuZ+MlZx28dgR+psu4uf/kJBf4Eb0Woihntl684xTaIniXwIGSw/OlHKY+w==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/@cap-js/sqlite/-/sqlite-1.7.7.tgz", + "integrity": "sha512-SOmFJMr6pjWOniFRkJsrI0BpQEQT5Q8o+IVZ/LXFj6+bAe0NQQztzxhMQx62V/Px3u58JJM3xkPMU+QC5PcJHw==", "dev": true, + "license": "SEE LICENSE", "dependencies": { - "@cap-js/db-service": "^1.9.0", + "@cap-js/db-service": "^1.14.1", "better-sqlite3": "^11.0.0" }, "peerDependencies": { @@ -241,9 +243,9 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz", - "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.0.tgz", + "integrity": "sha512-zdHg2FPIFNKPdcHWtiNT+jEFCHYVplAXRDlQDyqy0zGx/q2parwh7brGJSiTxRk/TSMkbM//zt/f5CHgyTyaSQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -256,18 +258,19 @@ } }, "node_modules/@eslint/core": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", - "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.0.tgz", + "integrity": "sha512-7ATR9F0e4W85D/0w7cU0SNj7qkAexMG+bAHEZOjo9akvGuhHE2m7umzWzfnpa0XAg5Kxc1BWmtPMV67jJ+9VUg==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, "node_modules/@eslint/eslintrc": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", - "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", "dev": true, "license": "MIT", "dependencies": { @@ -289,10 +292,11 @@ } }, "node_modules/@eslint/js": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz", - "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz", + "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -308,10 +312,11 @@ } }, "node_modules/@eslint/plugin-kit": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.0.tgz", - "integrity": "sha512-vH9PiIMMwvhCx31Af3HiGzsVNULDbyVkHXwlemn/B0TFj/00ho3y55efXrUZTfQipxoHC5u4xq6zblww1zm1Ig==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.3.tgz", + "integrity": "sha512-2b/g5hRmpbb1o4GnTZax9N9m0FXzz9OV42ZzI4rDDMDuHUqigAiQCEWChBWCY4ztAGVRjoWT19v0yMmc5/L5kA==", "dev": true, + "license": "Apache-2.0", "dependencies": { "levn": "^0.4.1" }, @@ -369,10 +374,11 @@ } }, "node_modules/@humanwhocodes/retry": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.0.tgz", - "integrity": "sha512-xnRgu9DxZbkWak/te3fcytNyp8MTbuiZIaueg2rgEvBuN55n04nwLYLU9TX/VVlusc9L2ZNXi99nUFNkHXtr5g==", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", "dev": true, + "license": "Apache-2.0", "engines": { "node": ">=18.18" }, @@ -595,6 +601,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -685,9 +692,9 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz", + "integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==", "dev": true, "license": "MIT", "dependencies": { @@ -1095,9 +1102,9 @@ "license": "MIT" }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "dependencies": { @@ -1294,26 +1301,27 @@ } }, "node_modules/eslint": { - "version": "9.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.14.0.tgz", - "integrity": "sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz", + "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.7.0", - "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.14.0", - "@eslint/plugin-kit": "^0.2.0", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.9.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.16.0", + "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@humanwhocodes/retry": "^0.4.0", + "@humanwhocodes/retry": "^0.4.1", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.5", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", @@ -1332,8 +1340,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" @@ -1374,6 +1381,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, + "license": "Apache-2.0", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -1386,6 +1394,7 @@ "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", @@ -2931,13 +2940,6 @@ "node": ">=6" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "license": "MIT" - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", From 32bc0ab94f1898251704a5d4a2cd0bfaff38063d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Dec 2024 16:00:38 +0000 Subject: [PATCH 4/6] Bump the production-dependencies group across 1 directory with 2 updates (#781) Bumps the production-dependencies group with 2 updates in the / directory: [@sap/cds](https://cap.cloud.sap/) and [@cap-js-community/odata-v2-adapter](https://github.com/cap-js-community/odata-v2-adapter). Updates `@sap/cds` from 8.4.0 to 8.5.0 Updates `@cap-js-community/odata-v2-adapter` from 1.13.7 to 1.13.8 - [Release notes](https://github.com/cap-js-community/odata-v2-adapter/releases) - [Changelog](https://github.com/cap-js-community/odata-v2-adapter/blob/main/CHANGELOG.md) - [Commits](https://github.com/cap-js-community/odata-v2-adapter/compare/v1.13.7...v1.13.8) --- updated-dependencies: - dependency-name: "@sap/cds" dependency-type: direct:production update-type: version-update:semver-minor dependency-group: production-dependencies - dependency-name: "@cap-js-community/odata-v2-adapter" dependency-type: direct:production update-type: version-update:semver-patch dependency-group: production-dependencies ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 046e8fe6..c4cf0581 100644 --- a/package-lock.json +++ b/package-lock.json @@ -108,9 +108,10 @@ } }, "node_modules/@cap-js-community/odata-v2-adapter": { - "version": "1.13.7", - "resolved": "https://registry.npmjs.org/@cap-js-community/odata-v2-adapter/-/odata-v2-adapter-1.13.7.tgz", - "integrity": "sha512-rmW1a1EycRJsEpR5lRFo/U37EeHcB7R3z7gSo7DseCzPjbA7D5lsqFaAfGG9IseYdTVAd+X1HH1MMT4fz4NVow==", + "version": "1.13.8", + "resolved": "https://registry.npmjs.org/@cap-js-community/odata-v2-adapter/-/odata-v2-adapter-1.13.8.tgz", + "integrity": "sha512-IYkUUJLMS8sNL+6H8NOT17pMKweItjEUqV9EctuHw8+pWsFLcK3GehztZrtPS9DfEBOD9tC/aPNU5+b5unmZrQ==", + "license": "Apache-2.0", "dependencies": { "body-parser": "^1.20.3", "body-parser-xml": "^2.0.5", @@ -388,9 +389,10 @@ } }, "node_modules/@sap/cds": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@sap/cds/-/cds-8.4.0.tgz", - "integrity": "sha512-nJzDmoyZVcnACZ2gHL03LRNZCDMV6fEW4t0PFg6cdvRAIiKl0s9/0zKp8kVDJpm6a+k5yvDx8nW2O10KqpMIVQ==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/@sap/cds/-/cds-8.5.0.tgz", + "integrity": "sha512-mRiLBPcY5vC1xi21pPqzMtp1HY9FOOFajkiuSArqnwtiyp2fxqWVombuVE9lTB2UyBl9bL8XXwrpjzDftIbnBg==", + "license": "SEE LICENSE IN LICENSE", "dependencies": { "@sap/cds-compiler": ">=5.1", "@sap/cds-fiori": "^1", From e0b9a29bbcb2ce8690cb9461ae8d11eb0044a317 Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Fri, 13 Dec 2024 07:09:54 +0100 Subject: [PATCH 5/6] .. --- test/cds.ql.test.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/test/cds.ql.test.js b/test/cds.ql.test.js index 4ebfe63f..ea60a341 100644 --- a/test/cds.ql.test.js +++ b/test/cds.ql.test.js @@ -672,13 +672,11 @@ describe('cds.ql → cqn', () => { describe(`INSERT...`, () => { test('entries ({a,b}, ...)', () => { const entries = [{ foo: 1 }, { boo: 2 }] - expect(INSERT(...entries).into(Foo)) - .to.eql(INSERT(entries).into(Foo)) - .to.eql(INSERT.into(Foo).entries(...entries)) - .to.eql(INSERT.into(Foo).entries(entries)) - .to.eql({ - INSERT: { into: { ref: ['Foo'] }, entries }, - }) + expect(INSERT(...entries).into(Foo).INSERT) + .to.eql(INSERT(entries).into(Foo).INSERT) + .to.eql(INSERT.into(Foo).entries(...entries).INSERT) + .to.eql(INSERT.into(Foo).entries(entries).INSERT) + .to.eql({ into: { ref: ['Foo'] }, entries }) }) test('rows ([1,2], ...)', () => { @@ -689,8 +687,9 @@ describe('cds.ql → cqn', () => { [1, 2], [3, 4], ]) + .INSERT ) - .to.eql(INSERT.into(Foo).columns('a', 'b').rows([1, 2], [3, 4])) + .to.eql(INSERT.into(Foo).columns('a', 'b').rows([1, 2], [3, 4]).INSERT) .to.eql({ INSERT: { into: { ref: ['Foo'] }, @@ -700,15 +699,15 @@ describe('cds.ql → cqn', () => { [3, 4], ], }, - }) + }.INSERT) }) test('values (1,2)', () => { - expect(INSERT.into(Foo).columns('a', 'b').values([1, 2])) - .to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2)) + expect(INSERT.into(Foo).columns('a', 'b').values([1, 2]).INSERT) + .to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2).INSERT) .to.eql({ INSERT: { into: { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] }, - }) + }.INSERT) }) test('w/ plain SQL', () => { From d1a4a65eae6b269cb3f91101555169c80784bb6b Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Fri, 13 Dec 2024 07:17:59 +0100 Subject: [PATCH 6/6] reverted accidental push --- test/cds.ql.test.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/test/cds.ql.test.js b/test/cds.ql.test.js index ea60a341..4ebfe63f 100644 --- a/test/cds.ql.test.js +++ b/test/cds.ql.test.js @@ -672,11 +672,13 @@ describe('cds.ql → cqn', () => { describe(`INSERT...`, () => { test('entries ({a,b}, ...)', () => { const entries = [{ foo: 1 }, { boo: 2 }] - expect(INSERT(...entries).into(Foo).INSERT) - .to.eql(INSERT(entries).into(Foo).INSERT) - .to.eql(INSERT.into(Foo).entries(...entries).INSERT) - .to.eql(INSERT.into(Foo).entries(entries).INSERT) - .to.eql({ into: { ref: ['Foo'] }, entries }) + expect(INSERT(...entries).into(Foo)) + .to.eql(INSERT(entries).into(Foo)) + .to.eql(INSERT.into(Foo).entries(...entries)) + .to.eql(INSERT.into(Foo).entries(entries)) + .to.eql({ + INSERT: { into: { ref: ['Foo'] }, entries }, + }) }) test('rows ([1,2], ...)', () => { @@ -687,9 +689,8 @@ describe('cds.ql → cqn', () => { [1, 2], [3, 4], ]) - .INSERT ) - .to.eql(INSERT.into(Foo).columns('a', 'b').rows([1, 2], [3, 4]).INSERT) + .to.eql(INSERT.into(Foo).columns('a', 'b').rows([1, 2], [3, 4])) .to.eql({ INSERT: { into: { ref: ['Foo'] }, @@ -699,15 +700,15 @@ describe('cds.ql → cqn', () => { [3, 4], ], }, - }.INSERT) + }) }) test('values (1,2)', () => { - expect(INSERT.into(Foo).columns('a', 'b').values([1, 2]).INSERT) - .to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2).INSERT) + expect(INSERT.into(Foo).columns('a', 'b').values([1, 2])) + .to.eql(INSERT.into(Foo).columns('a', 'b').values(1, 2)) .to.eql({ INSERT: { into: { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] }, - }.INSERT) + }) }) test('w/ plain SQL', () => {