Compare commits

...

79 Commits

Author SHA1 Message Date
Daniel Hutzel
56ea989c19 Merge branch 'main' into new-capire 2024-12-18 15:57:32 +01:00
Daniel Hutzel
d1a4a65eae reverted accidental push 2024-12-13 07:17:59 +01:00
Daniel Hutzel
e0b9a29bbc .. 2024-12-13 07:09:54 +01:00
dependabot[bot]
32bc0ab94f 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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-04 16:00:38 +00:00
dependabot[bot]
b652150788 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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-04 16:58:42 +01:00
Johannes Vogt
4379170c89 Merge pull request #779 from SAP-samples/fix-media-server
fix media server
2024-11-25 11:45:27 +01:00
Johannes Vogt
29f9016c37 Merge branch 'main' into fix-media-server 2024-11-25 10:09:51 +01:00
Daniel Hutzel
b1a13f2460 common as plugin 2024-11-25 00:31:04 +01:00
Johannes Vogt
ee028e76b6 fix media server 2024-11-22 11:40:55 +01:00
Daniel Hutzel
22709b8cdb Improved samples for new capire 2024-11-19 12:29:19 +01:00
dependabot[bot]
33b7691f51 Bump the development-dependencies group with 2 updates (#773)
Bumps the development-dependencies group with 2 updates: [@cap-js/sqlite](https://github.com/cap-js/cds-dbs) and [eslint](https://github.com/eslint/eslint).


Updates `@cap-js/sqlite` from 1.7.4 to 1.7.5
- [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.4...sqlite-v1.7.5)

Updates `eslint` from 9.13.0 to 9.14.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.13.0...v9.14.0)

---
updated-dependencies:
- dependency-name: "@cap-js/sqlite"
  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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 13:04:24 +00:00
dependabot[bot]
66f55959ea Bump the production-dependencies group with 2 updates (#772)
Bumps the production-dependencies group with 2 updates: [@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.3.1 to 8.4.0

Updates `@cap-js-community/odata-v2-adapter` from 1.13.6 to 1.13.7
- [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.6...v1.13.7)

---
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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 14:02:28 +01:00
Daniel Hutzel
5e5ed7749d More i18n content 2024-11-04 12:40:24 +01:00
Daniel Hutzel
543405e6bb I18n content added 2024-11-04 07:40:55 +01:00
dependabot[bot]
396ddab332 Bump @cap-js/cds-types in the development-dependencies group (#771)
Bumps the development-dependencies group with 1 update: [@cap-js/cds-types](https://github.com/cap-js/cds-types).


Updates `@cap-js/cds-types` from 0.6.5 to 0.7.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.6.5...v0.7.0)

---
updated-dependencies:
- dependency-name: "@cap-js/cds-types"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-29 09:46:16 +01:00
Daniel Hutzel
7c4478b385 OrderNo field length increased to 44
... to avoid validation errors
2024-10-22 12:12:51 +02:00
dependabot[bot]
1cc507a484 Bump @cap-js-community/odata-v2-adapter (#769)
Bumps the production-dependencies group with 1 update: [@cap-js-community/odata-v2-adapter](https://github.com/cap-js-community/odata-v2-adapter).


Updates `@cap-js-community/odata-v2-adapter` from 1.13.5 to 1.13.6
- [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.5...v1.13.6)

---
updated-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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 14:21:00 +00:00
dependabot[bot]
c0358bce4d Bump the development-dependencies group across 1 directory with 2 updates (#770)
Bumps the development-dependencies group with 2 updates in the / directory: [@cap-js/sqlite](https://github.com/cap-js/cds-dbs) and [eslint](https://github.com/eslint/eslint).


Updates `@cap-js/sqlite` from 1.7.3 to 1.7.4
- [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.3...sqlite-v1.7.4)

Updates `eslint` from 9.11.1 to 9.13.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.11.1...v9.13.0)

---
updated-dependencies:
- dependency-name: "@cap-js/sqlite"
  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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-21 16:18:56 +02:00
dependabot[bot]
010521b120 Bump the production-dependencies group across 1 directory with 3 updates (#767)
Bumps the production-dependencies group with 3 updates in the / directory: [@sap/cds](https://cap.cloud.sap/), [express](https://github.com/expressjs/express) and [@cap-js-community/odata-v2-adapter](https://github.com/cap-js-community/odata-v2-adapter).


Updates `@sap/cds` from 8.2.3 to 8.3.1

Updates `express` from 4.21.0 to 4.21.1
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.1/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.0...4.21.1)

Updates `@cap-js-community/odata-v2-adapter` from 1.13.3 to 1.13.5
- [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.3...v1.13.5)

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
- dependency-name: express
  dependency-type: direct:production
  update-type: version-update:semver-patch
  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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-16 09:52:16 +02:00
dependabot[bot]
48e45729ff Bump eslint from 9.11.0 to 9.11.1 in the development-dependencies group (#764)
Bumps the development-dependencies group with 1 update: [eslint](https://github.com/eslint/eslint).


Updates `eslint` from 9.11.0 to 9.11.1
- [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.11.0...v9.11.1)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 15:14:54 +02:00
dependabot[bot]
d124a903cc Bump eslint from 9.10.0 to 9.11.0 in the development-dependencies group (#763)
Bumps the development-dependencies group with 1 update: [eslint](https://github.com/eslint/eslint).


Updates `eslint` from 9.10.0 to 9.11.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.10.0...v9.11.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 13:34:32 +00:00
dependabot[bot]
8587be71c2 Bump the production-dependencies group with 2 updates (#762)
Bumps the production-dependencies group with 2 updates: [@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.2.2 to 8.2.3

Updates `@cap-js-community/odata-v2-adapter` from 1.13.2 to 1.13.3
- [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.2...v1.13.3)

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 15:32:30 +02:00
Christian Georgi
eb9a5ed971 Add cds-types (#761)
Also add Node 22 to CI
2024-09-16 14:52:43 +02:00
dependabot[bot]
2f91f7d2d4 Bump @sap/cds from 8.2.1 to 8.2.2 in the production-dependencies group (#760)
Bumps the production-dependencies group with 1 update: [@sap/cds](https://cap.cloud.sap/).


Updates `@sap/cds` from 8.2.1 to 8.2.2

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-16 14:13:50 +02:00
dependabot[bot]
23cc7794b3 Bump path-to-regexp and express (#759)
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) to 0.1.10 and updates ancestor dependency [express](https://github.com/expressjs/express). These dependencies need to be updated together.


Updates `path-to-regexp` from 0.1.7 to 0.1.10
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v0.1.7...v0.1.10)

Updates `express` from 4.19.2 to 4.21.0
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.0/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.19.2...4.21.0)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-type: indirect
- dependency-name: express
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-12 08:06:33 +02:00
dependabot[bot]
26d1b1a655 Bump eslint from 9.9.1 to 9.10.0 in the development-dependencies group (#758)
Bumps the development-dependencies group with 1 update: [eslint](https://github.com/eslint/eslint).


Updates `eslint` from 9.9.1 to 9.10.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.9.1...v9.10.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 13:34:04 +00:00
dependabot[bot]
a8d6fc43b5 Bump @sap/cds from 8.1.1 to 8.2.1 in the production-dependencies group (#757)
Bumps the production-dependencies group with 1 update: [@sap/cds](https://cap.cloud.sap/).


Updates `@sap/cds` from 8.1.1 to 8.2.1

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 15:32:17 +02:00
dependabot[bot]
0ba1f2e294 Bump axios from 1.7.5 to 1.7.7 in the development-dependencies group (#756)
Bumps the development-dependencies group with 1 update: [axios](https://github.com/axios/axios).


Updates `axios` from 1.7.5 to 1.7.7
- [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.5...v1.7.7)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 12:18:09 +00:00
dependabot[bot]
53fbbaa3da Bump @cap-js-community/odata-v2-adapter (#755)
Bumps the production-dependencies group with 1 update: [@cap-js-community/odata-v2-adapter](https://github.com/cap-js-community/odata-v2-adapter).


Updates `@cap-js-community/odata-v2-adapter` from 1.13.1 to 1.13.2
- [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.1...v1.13.2)

---
updated-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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 14:16:24 +02:00
Daniel Hutzel
d844642ce9 Optimized expands from Vue.js App 2024-08-28 13:35:03 +02:00
dependabot[bot]
8343013d3a Bump the development-dependencies group with 2 updates (#754)
Bumps the development-dependencies group with 2 updates: [axios](https://github.com/axios/axios) and [eslint](https://github.com/eslint/eslint).


Updates `axios` from 1.7.4 to 1.7.5
- [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.4...v1.7.5)

Updates `eslint` from 9.9.0 to 9.9.1
- [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.9.0...v9.9.1)

---
updated-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-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 14:19:50 +02:00
dependabot[bot]
9db71a6635 Bump axios from 1.7.3 to 1.7.4 in the development-dependencies group (#753)
Bumps the development-dependencies group with 1 update: [axios](https://github.com/axios/axios).


Updates `axios` from 1.7.3 to 1.7.4
- [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.3...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 14:49:30 +02:00
dependabot[bot]
a9de08222c Bump eslint from 9.8.0 to 9.9.0 in the development-dependencies group (#752)
Bumps the development-dependencies group with 1 update: [eslint](https://github.com/eslint/eslint).


Updates `eslint` from 9.8.0 to 9.9.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.8.0...v9.9.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 14:14:07 +00:00
dependabot[bot]
daabec1ce9 Bump @sap/cds from 8.1.0 to 8.1.1 in the production-dependencies group (#751)
Bumps the production-dependencies group with 1 update: [@sap/cds](https://cap.cloud.sap/).


Updates `@sap/cds` from 8.1.0 to 8.1.1

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 16:11:57 +02:00
Daniel Schlachter
cf7506f2f7 Better error message if modules are not found (#750)
---------

Co-authored-by: Christian Georgi <chgeo@users.noreply.github.com>
Co-authored-by: Daniel Schlachter <daniel.schlachter@sap.com>
Co-authored-by: Andre Meyering <info@andremeyering.de>
2024-08-07 20:23:32 +02:00
dependabot[bot]
e6358b55d1 Bump @cap-js-community/odata-v2-adapter (#748)
Bumps the production-dependencies group with 1 update: [@cap-js-community/odata-v2-adapter](https://github.com/cap-js-community/odata-v2-adapter).


Updates `@cap-js-community/odata-v2-adapter` from 1.13.0 to 1.13.1
- [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.0...v1.13.1)

---
updated-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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 13:29:00 +00:00
dependabot[bot]
e7927b39b1 Bump axios from 1.7.2 to 1.7.3 in the development-dependencies group (#749)
Bumps the development-dependencies group with 1 update: [axios](https://github.com/axios/axios).


Updates `axios` from 1.7.2 to 1.7.3
- [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.2...v1.7.3)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 15:27:09 +02:00
Christian Georgi
7b7686cb29 Use npm ci instead of npm install 2024-07-29 21:06:18 +02:00
Pierre Fritsch
e2902640e3 Add test to illustrate how to call actions locally (#276)
* Add test to illustrate how to call actions locally

Add the code sample from the capire section [Unbound Actions / Functions](https://cap.cloud.sap/docs/node.js/services#-unbound-actions--functions) as a test in the code sample repository.

Signed-off-by: Pierre Fritsch <PierreFritsch@users.noreply.github.com>

* Wrap the action calls into a transaction

Signed-off-by: Pierre Fritsch <PierreFritsch@users.noreply.github.com>

* Add assertions

Signed-off-by: Pierre Fritsch <PierreFritsch@users.noreply.github.com>

* Update test/consuming-actions.test.js

Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>

* Update test/consuming-actions.test.js

Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>

* Update test/consuming-actions.test.js

Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>

* Update test/consuming-actions.test.js

Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>

* Update test/consuming-actions.test.js

Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>

* Update test/consuming-actions.test.js

Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>

* Update test/consuming-actions.test.js

---------

Signed-off-by: Pierre Fritsch <PierreFritsch@users.noreply.github.com>
Co-authored-by: sjvans <30337871+sjvans@users.noreply.github.com>
2024-07-29 20:38:54 +02:00
Pierre Fritsch
ccb14d9791 README: Fix link to "Getting Started" page (#744)
Co-authored-by: Christian Georgi <chgeo@users.noreply.github.com>
2024-07-29 15:22:05 +00:00
dependabot[bot]
3f3af6c39c Bump @sap/cds from 8.0.4 to 8.1.0 in the production-dependencies group (#746)
Bumps the production-dependencies group with 1 update: [@sap/cds](https://cap.cloud.sap/).


Updates `@sap/cds` from 8.0.4 to 8.1.0

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 14:19:03 +00:00
dependabot[bot]
c8aba771c5 Bump the development-dependencies group with 2 updates (#747)
Bumps the development-dependencies group with 2 updates: [chai](https://github.com/chaijs/chai) and [eslint](https://github.com/eslint/eslint).


Updates `chai` from 4.4.1 to 4.5.0
- [Release notes](https://github.com/chaijs/chai/releases)
- [Changelog](https://github.com/chaijs/chai/blob/main/History.md)
- [Commits](https://github.com/chaijs/chai/compare/v4.4.1...v4.5.0)

Updates `eslint` from 9.7.0 to 9.8.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.7.0...v9.8.0)

---
updated-dependencies:
- dependency-name: chai
  dependency-type: direct:development
  update-type: version-update:semver-minor
  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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 16:17:35 +02:00
dependabot[bot]
a90175f28d Bump semver from 7.6.2 to 7.6.3 in the development-dependencies group (#743)
Bumps the development-dependencies group with 1 update: [semver](https://github.com/npm/node-semver).


Updates `semver` from 7.6.2 to 7.6.3
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.6.2...v7.6.3)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 17:21:00 +02:00
dependabot[bot]
f41416408a Bump the production-dependencies group with 2 updates (#742)
Bumps the production-dependencies group with 2 updates: [@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.0.3 to 8.0.4

Updates `@cap-js-community/odata-v2-adapter` from 1.12.12 to 1.13.0
- [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.12.12...v1.13.0)

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
- dependency-name: "@cap-js-community/odata-v2-adapter"
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 16:12:42 +02:00
Daniel Hutzel
7a2e345cd5 fix bookshop requests.http 2024-07-16 15:29:08 +02:00
Daniel Hutzel
722cf622eb Simplify hello world sample 2024-07-16 15:28:27 +02:00
Daniel Hutzel
b8d389a40a Update genres.http 2024-07-15 18:30:12 +02:00
Daniel Hutzel
82c633ce01 Post TechEd cosmetics (#619)
* Post TechEd cosmetics

* Update package-lock.json
2024-07-15 14:45:03 +02:00
Daniel Hutzel
3161758e5f chore: reducing 3rd dependencies (#722)
* chore: reducing 3rd dependencies

* Update package.json

Co-authored-by: Bob den Os <108393871+BobdenOs@users.noreply.github.com>

* Keep using jest by default

---------

Co-authored-by: Bob den Os <108393871+BobdenOs@users.noreply.github.com>
2024-07-15 14:37:58 +02:00
Daniel Hutzel
02ea798f5f Streamlined eslint usage for eslint9 w/ cds8 (#719)
* Streamlined eslint usage

* import from @sap/cds instead of @sap/cds/lib

* Using @sap/cds/eslint.js

* eslint.config.mjs aktualisieren

* Adjusted eslint usage for eslint9 with cds8
2024-07-15 14:27:03 +02:00
Daniel Hutzel
09f02676ef Quirks mode is gone w/ cds8 (#729)
* Quirks mode is gone w/ cds8

* Update test/cds.ql.test.js

* Updated package-lock.json
2024-07-15 14:16:10 +02:00
Daniel Hutzel
cae0d36206 Fixed id generation for non-draft requests 2024-07-11 11:35:40 +02:00
Christian Georgi
ea79264e9d Fix ignore version 2024-07-01 16:47:56 +02:00
dependabot[bot]
c2d1217e4a Bump the production-dependencies group across 1 directory with 2 updates (#737)
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 7.9.2 to 7.9.3

Updates `@cap-js-community/odata-v2-adapter` from 1.12.10 to 1.12.11
- [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.12.10...v1.12.11)

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 16:46:51 +02:00
Christian Georgi
d739680180 Exclude chai-as-promised 8 2024-06-24 14:47:22 +02:00
dependabot[bot]
326729e03d Bump braces from 3.0.2 to 3.0.3 (#733)
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 09:13:47 +02:00
Daniel Hutzel
6e56eb9c01 formatting 2024-06-13 00:22:28 +02:00
dependabot[bot]
1a0d3e60cf Bump @cap-js-community/odata-v2-adapter (#731)
Bumps the production-dependencies group with 1 update: [@cap-js-community/odata-v2-adapter](https://github.com/cap-js-community/odata-v2-adapter).


Updates `@cap-js-community/odata-v2-adapter` from 1.12.9 to 1.12.10
- [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.12.9...v1.12.10)

---
updated-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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 14:06:53 +02:00
dependabot[bot]
402a5816e3 Bump @sap/cds from 7.9.1 to 7.9.2 in the production-dependencies group (#723)
Bumps the production-dependencies group with 1 update: [@sap/cds](https://cap.cloud.sap/).


Updates `@sap/cds` from 7.9.1 to 7.9.2

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 17:58:08 +00:00
dependabot[bot]
cdb9ae6436 Bump the development-dependencies group across 1 directory with 3 updates (#730)
Bumps the development-dependencies group with 3 updates in the / directory: [axios](https://github.com/axios/axios), [eslint](https://github.com/eslint/eslint) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `axios` from 1.7.0 to 1.7.2
- [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.0...v1.7.2)

Updates `eslint` from 9.3.0 to 9.4.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.3.0...v9.4.0)

Updates `@types/node` from 20.12.12 to 20.14.0
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-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
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 19:56:16 +02:00
Daniel Hutzel
4ba262f02a . 2024-05-31 14:23:56 +02:00
sjvans
187014d98b adjust content-type check (#728) 2024-05-29 10:42:35 +02:00
Daniel Hutzel
85f24970de Fully revert hacks (#727) 2024-05-29 09:58:02 +02:00
Samuel Brucksch
a191c4fd50 Partially revert "fix: adjusted tests for new OData adapter" (#726) 2024-05-28 18:22:45 +02:00
Dr. David A. Kunz
ac3cfa81c7 Merge pull request #725 from SAP-samples/fix-for-new-adapter
fix: adjusted tests for new OData adapter
2024-05-28 14:40:32 +02:00
Samuel Brucksch
710dd7ac32 make it work 2024-05-28 14:27:08 +02:00
dependabot[bot]
bbe2bae087 Bump axios from 1.6.8 to 1.7.0 in the development-dependencies group (#721)
Bumps the development-dependencies group with 1 update: [axios](https://github.com/axios/axios).


Updates `axios` from 1.6.8 to 1.7.0
- [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.6.8...v1.7.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 22:12:40 +02:00
Daniel Hutzel
ec8608faab . 2024-05-19 16:14:38 +02:00
Daniel Hutzel
4c46f115f5 Corrected tests 2024-05-19 10:53:14 +02:00
Daniel Hutzel
c6b88f6b66 import from @sap/cds instead of @sap/cds/lib 2024-05-14 15:57:14 +02:00
Daniel Hutzel
aaa94e2d5f Improve tests to also work with node --test 2024-05-14 14:37:37 +02:00
dependabot[bot]
0f6809a45b Bump the development-dependencies group with 5 updates (#720)
Bumps the development-dependencies group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [@cap-js/sqlite](https://github.com/cap-js/cds-dbs) | `1.6.0` | `1.7.0` |
| [@sap/eslint-plugin-cds](https://cap.cloud.sap/) | `3.0.2` | `3.0.3` |
| [chai-as-promised](https://github.com/domenic/chai-as-promised) | `7.1.1` | `7.1.2` |
| [semver](https://github.com/npm/node-semver) | `7.6.0` | `7.6.2` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `20.12.8` | `20.12.11` |


Updates `@cap-js/sqlite` from 1.6.0 to 1.7.0
- [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.6.0...sqlite-v1.7.0)

Updates `@sap/eslint-plugin-cds` from 3.0.2 to 3.0.3

Updates `chai-as-promised` from 7.1.1 to 7.1.2
- [Release notes](https://github.com/domenic/chai-as-promised/releases)
- [Commits](https://github.com/domenic/chai-as-promised/compare/v7.1.1...v7.1.2)

Updates `semver` from 7.6.0 to 7.6.2
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.6.0...v7.6.2)

Updates `@types/node` from 20.12.8 to 20.12.11
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@cap-js/sqlite"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: "@sap/eslint-plugin-cds"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: chai-as-promised
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: semver
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 14:57:32 +02:00
dependabot[bot]
6249fa2270 Bump @cap-js-community/odata-v2-adapter (#717)
Bumps the production-dependencies group with 1 update: [@cap-js-community/odata-v2-adapter](https://github.com/cap-js-community/odata-v2-adapter).


Updates `@cap-js-community/odata-v2-adapter` from 1.12.8 to 1.12.9
- [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.12.8...v1.12.9)

---
updated-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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 12:47:59 +00:00
dependabot[bot]
9e02e2c796 Bump eslint from 9.1.1 to 9.2.0 in the development-dependencies group (#718)
Bumps the development-dependencies group with 1 update: [eslint](https://github.com/eslint/eslint).


Updates `eslint` from 9.1.1 to 9.2.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.1.1...v9.2.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-06 14:46:33 +02:00
Daniel O'Grady
d9f50d635f Add package lock and eslint config (#711) 2024-05-03 12:40:11 +02:00
Johannes Vogel
546f374b08 deps: open up cds range for next major (#714) 2024-05-02 10:02:32 +02:00
dependabot[bot]
bb127bcc58 Bump @sap/cds from 7.8.1 to 7.8.2 in the production-dependencies group (#712)
Bumps the production-dependencies group with 1 update: [@sap/cds](https://cap.cloud.sap/).


Updates `@sap/cds` from 7.8.1 to 7.8.2

---
updated-dependencies:
- dependency-name: "@sap/cds"
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: production-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 14:53:56 +02:00
dependabot[bot]
d08749fd21 Bump the production-dependencies group with 2 updates (#709)
Bumps the production-dependencies group with 2 updates: [@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 7.7.3 to 7.8.1

Updates `@cap-js-community/odata-v2-adapter` from 1.12.7 to 1.12.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.12.7...v1.12.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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 13:14:02 +00:00
dependabot[bot]
be5696b14e Bump the development-dependencies group with 3 updates (#710)
Bumps the development-dependencies group with 3 updates: [@sap/eslint-plugin-cds](https://cap.cloud.sap/), [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) and [typescript](https://github.com/Microsoft/TypeScript).


Updates `@sap/eslint-plugin-cds` from 2.6.7 to 2.7.0

Updates `@types/node` from 20.12.5 to 20.12.7
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Updates `typescript` from 5.4.4 to 5.4.5
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v5.4.4...v5.4.5)

---
updated-dependencies:
- dependency-name: "@sap/eslint-plugin-cds"
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: development-dependencies
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: development-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 15:12:36 +02:00
66 changed files with 3746 additions and 3956 deletions

View File

@@ -1,31 +0,0 @@
{
"extends": [
"plugin:@sap/cds/recommended",
"eslint:recommended"
],
"env": {
"browser": true,
"es2022": true,
"node": true,
"jest": true,
"mocha": true
},
"globals": {
"SELECT": true,
"INSERT": true,
"UPSERT": true,
"UPDATE": true,
"DELETE": true,
"CREATE": true,
"DROP": true,
"CDL": true,
"CQL": true,
"cds": true
},
"rules": {
"no-console": "off",
"require-atomic-updates": "off",
"require-await":"warn",
"no-unused-vars": ["warn", { "argsIgnorePattern": "_" }]
}
}

View File

@@ -15,3 +15,6 @@ updates:
- dependency-name: "chai"
# chai 5 doesn't work atm w/ cds.test, TODO fix that in cds.test
versions: ["5.x"]
- dependency-name: "chai-as-promised"
# chai-as-promised 8 doesn't work atm w/ cds.test, TODO fix that in cds.test
versions: ["8.x"]

View File

@@ -11,18 +11,28 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 18.x]
node-version: [22.x, 20.x, 18.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
- run: npm ci
- run: npm run lint

10
.vscode/settings.json vendored
View File

@@ -13,13 +13,5 @@
"**/cds/lib/req/cds-context.js",
"**/odata-v4/okra/**"
]
},
"eslint.probe": [
"cds",
"csn",
"csv",
"csv (semicolon)",
"tsv",
"tab"
]
}
}

View File

@@ -13,7 +13,7 @@ Find here a collection of samples for the [SAP Cloud Application Programming Mod
### Preliminaries
1. Ensure you have the latest LTS version of Node.js installed (see [Getting Started](https://cap.cloud.sap/docs/get-started/))
1. Ensure you have the latest LTS version of Node.js installed (see [Getting Started](https://cap.cloud.sap/docs/get-started/jumpstart))
2. Install [**@sap/cds-dk**](https://cap.cloud.sap/docs/get-started/) globally:
```sh
@@ -36,7 +36,7 @@ cd samples
In the samples folder run:
```sh
npm install
npm ci
```
### Run

View File

@@ -19,13 +19,13 @@ const books = Vue.createApp ({
search: ({target:{value:v}}) => books.fetch(v && '&$search='+v),
async fetch (etc='') {
const {data} = await GET(`/ListOfBooks?$expand=genre,currency${etc}`)
const {data} = await GET(`/Books?${etc}`)
books.list = data.value
},
async inspect (eve) {
const book = books.book = books.list [eve.currentTarget.rowIndex-1]
const res = await GET(`/Books/${book.ID}?$select=descr,stock,image`)
const res = await GET(`/Book/${book.ID}?$select=descr,stock,image`)
Object.assign (book, res.data)
books.order = { quantity:1 }
setTimeout (()=> $('form > input').focus(), 111)
@@ -77,7 +77,7 @@ function csrfToken (request) {
document.csrfToken = token
request.headers['x-csrf-token'] = document.csrfToken
return request
}).catch(_ => {
}).catch(() => {
document.csrfToken = null // set mark to not try again
return request
})

View File

@@ -45,11 +45,11 @@
<tr v-for="book in list" v-bind:id="book.ID" v-on:click="inspect">
<td>{{ book.title }}</td>
<td>{{ book.author }}</td>
<td>{{ book.genre.name }}</td>
<td>{{ book.genre }}</td>
<td class="rating-stars">
{{ ('★'.repeat(Math.round(book.rating))+'☆☆☆☆☆').slice(0,5) }} ({{ book.numberOfReviews }})
</td>
<td>{{ book.currency && book.currency.symbol }} {{ book.price }}</td>
<td>{{ book.currency }} {{ book.price }}</td>
</tr>
</table>

View File

@@ -1,3 +1,5 @@
const cds = require('@sap/cds')
/**
* In order to keep basic bookshop sample as simple as possible, we don't add
* reuse dependencies. This db/init.js ensures we still have a minimum set of
@@ -6,7 +8,7 @@
// NOTE: We use cds.on('served') to delay the UPSERTs after the db init
// to run after all INSERTs from .csv files happened.
module.exports = cds.on('served', ()=> cds.run(
module.exports = cds.on('served', ()=>
UPSERT.into ('sap.common.Currencies') .columns (
[ 'code', 'symbol', 'name' ]
) .rows (
@@ -16,4 +18,4 @@ module.exports = cds.on('served', ()=> cds.run(
[ 'ILS', '₪', 'Shekel' ],
[ 'JPY', '¥', 'Yen' ],
)
))
)

View File

@@ -1,2 +0,0 @@
const { CatalogService } = require('./srv/cat-service')
module.exports = { CatalogService }

View File

@@ -13,7 +13,7 @@
"@cap-js/sqlite": "*"
},
"dependencies": {
"@sap/cds": "^7",
"@sap/cds": ">=7",
"express": "^4.17.1"
},
"scripts": {

View File

@@ -1,5 +1,5 @@
using { sap.capire.bookshop as my } from '../db/schema';
service AdminService @(requires:'admin', path:'/admin') {
entity Books as projection on my.Books;
entity Authors as projection on my.Authors;
// entity Authors as projection on my.Authors;
}

View File

@@ -1,13 +1,14 @@
const cds = require('@sap/cds/lib')
const cds = require('@sap/cds')
module.exports = class AdminService extends cds.ApplicationService { init(){
this.before ('NEW','Authors', genid)
this.before ('NEW','Books', genid)
this.before (['NEW','CREATE'],'Authors', genid)
this.before (['NEW','CREATE'],'Books', genid)
return super.init()
}}
/** Generate primary keys for target entity in request */
async function genid (req) {
if (req.data.ID) return
const {id} = await SELECT.one.from(req.target).columns('max(ID) as id')
req.data.ID = id - id % 100 + 100 + 1
req.data.ID = id + 4 // Note: that is not safe! ok for this sample only.
}

View File

@@ -2,15 +2,20 @@ using { sap.capire.bookshop as my } from '../db/schema';
service CatalogService @(path:'/browse') {
/** For displaying lists of Books */
@readonly entity ListOfBooks as projection on Books
excluding { descr };
@readonly entity Books as projection on Book excluding { descr };
/** For display in details pages */
@readonly entity Books as projection on my.Books { *,
author.name as author
} excluding { createdBy, modifiedBy };
@readonly entity Book as projection on my.Books { *,
currency.name as currencyName, // flattened
currency.symbol as currency, // flattened
author.name as author, // flattened
genre.name as genre, // flattened
} excluding {
createdBy, modifiedBy, // as end users shouldn't see them
localized, texts, // as end users don't need them
};
@requires: 'authenticated-user'
action submitOrder ( book: Books:ID, quantity: Integer ) returns { stock: Integer };
event OrderedBook : { book: Books:ID; quantity: Integer; buyer: String };
action submitOrder ( book: Book:ID, quantity: Integer ) returns { stock: Integer };
event OrderedBook : { book: Book:ID; quantity: Integer; buyer: String };
}

View File

@@ -1,10 +1,12 @@
module.exports = class CatalogService extends cds.ApplicationService { init() {
const cds = require('@sap/cds')
class CatalogService extends cds.ApplicationService { init() {
const { Books } = cds.entities('sap.capire.bookshop')
const { ListOfBooks } = this.entities
const { Books:Book } = this.entities
// Add some discount for overstocked books
this.after('each', ListOfBooks, book => {
this.after('each', Book, book => {
if (book.stock > 111) book.title += ` -- 11% discount!`
})
@@ -32,3 +34,5 @@ module.exports = class CatalogService extends cds.ApplicationService { init() {
// Delegate requests to the underlying generic service
return super.init()
}}
module.exports = CatalogService

View File

@@ -3,15 +3,15 @@
# Genres
#
GET http://localhost:4004/test/Genres?
GET http://localhost:4004/odata/v4/test/Genres?
###
GET http://localhost:4004/test/Genres?
GET http://localhost:4004/odata/v4/test/Genres?
&$filter=parent_ID eq null&$select=name
&$expand=children($select=name)
###
POST http://localhost:4004/test/Genres?
POST http://localhost:4004/odata/v4/test/Genres?
Content-Type: application/json
{ "ID":100, "name":"Some Sample Genres...", "children":[
@@ -26,13 +26,13 @@ Content-Type: application/json
]}
###
GET http://localhost:4004/test/Genres(100)?
GET http://localhost:4004/odata/v4/test/Genres(100)?
# &$expand=children
# &$expand=children($expand=children($expand=children($expand=children)))
###
DELETE http://localhost:4004/test/Genres(103)
DELETE http://localhost:4004/odata/v4/test/Genres(103)
###
DELETE http://localhost:4004/test/Genres(100)
DELETE http://localhost:4004/odata/v4/test/Genres(100)
###

View File

@@ -1,5 +1,6 @@
@server = http://localhost:4004
@me = Authorization: Basic {{$processEnv USER}}:
@alice = Authorization: Basic alice:
### ------------------------------------------------------------------------
@@ -16,11 +17,11 @@ GET {{server}}/browse/$metadata
### ------------------------------------------------------------------------
# Browse Books as any user
GET {{server}}/browse/ListOfBooks?
GET {{server}}/admin/Books?
# &$select=title,stock
&$expand=genre
# &sap-language=de
{{me}}
{{alice}}
### ------------------------------------------------------------------------
@@ -30,13 +31,13 @@ GET {{server}}/admin/Authors?
# &$expand=books($select=title;$expand=currency)
# &$filter=ID eq 101
# &sap-language=de
Authorization: Basic alice:
{{alice}}
### ------------------------------------------------------------------------
# Create Author
POST {{server}}/admin/Authors
Content-Type: application/json;IEEE754Compatible=true
Authorization: Basic alice:
{{alice}}
{
"ID": 112,
@@ -49,7 +50,7 @@ Authorization: Basic alice:
# Create book
POST {{server}}/admin/Books
Content-Type: application/json;IEEE754Compatible=true
Authorization: Basic alice:
{{alice}}
{
"ID": 2,
@@ -67,7 +68,7 @@ Authorization: Basic alice:
# Put image to books
PUT {{server}}/admin/Books(2)/image
Content-Type: image/png
Authorization: Basic alice:
{{alice}}
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANwAAADcCAYAAAAbWs+BAAAGwElEQVR4Ae3cwZFbNxBFUY5rkrDTmKAUk5QT03Aa44U22KC7NHptw+DRikVAXf8fzC3u8Hj4R4AAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAgZzAW26USQT+e4HPx+Mz+RRvj0e0kT+SD2cWAQK1gOBqH6sEogKCi3IaRqAWEFztY5VAVEBwUU7DCNQCgqt9rBKICgguymkYgVpAcLWPVQJRAcFFOQ0jUAsIrvaxSiAqILgop2EEagHB1T5WCUQFBBflNIxALSC42scqgaiA4KKchhGoBQRX+1glEBUQXJTTMAK1gOBqH6sEogKCi3IaRqAWeK+Xb1z9iN558fHxcSPS9p2ezx/ROz4e4TtIHt+3j/61hW9f+2+7/+UXbifjewIDAoIbQDWSwE5AcDsZ3xMYEBDcAKqRBHYCgtvJ+J7AgIDgBlCNJLATENxOxvcEBgQEN4BqJIGdgOB2Mr4nMCAguAFUIwnsBAS3k/E9gQEBwQ2gGklgJyC4nYzvCQwICG4A1UgCOwHB7WR8T2BAQHADqEYS2AkIbifjewIDAoIbQDWSwE5AcDsZ3xMYEEjfTzHwiK91B8npd6Q8n8/oGQ/ckRJ9vvQwv3BpUfMIFAKCK3AsEUgLCC4tah6BQkBwBY4lAmkBwaVFzSNQCAiuwLFEIC0guLSoeQQKAcEVOJYIpAUElxY1j0AhILgCxxKBtIDg0qLmESgEBFfgWCKQFhBcWtQ8AoWA4AocSwTSAoJLi5pHoBAQXIFjiUBaQHBpUfMIFAKCK3AsEUgLCC4tah6BQmDgTpPsHSTFs39p6fQ7Q770UsV/Ov19X+2OFL9wxR+rJQJpAcGlRc0jUAgIrsCxRCAtILi0qHkECgHBFTiWCKQFBJcWNY9AISC4AscSgbSA4NKi5hEoBARX4FgikBYQXFrUPAKFgOAKHEsE0gKCS4uaR6AQEFyBY4lAWkBwaVHzCBQCgitwLBFICwguLWoegUJAcAWOJQJpAcGlRc0jUAgIrsCxRCAt8J4eePq89B0ar3ZnyOnve/rfn1+400/I810lILirjtPLnC4guNNPyPNdJSC4q47Ty5wuILjTT8jzXSUguKuO08ucLiC400/I810lILirjtPLnC4guNNPyPNdJSC4q47Ty5wuILjTT8jzXSUguKuO08ucLiC400/I810lILirjtPLnC4guNNPyPNdJSC4q47Ty5wuILjTT8jzXSUguKuO08ucLiC400/I810l8JZ/m78+szP/zI47fJo7Q37vgJ7PHwN/07/3TOv/9gu3avhMYFhAcMPAxhNYBQS3avhMYFhAcMPAxhNYBQS3avhMYFhAcMPAxhNYBQS3avhMYFhAcMPAxhNYBQS3avhMYFhAcMPAxhNYBQS3avhMYFhAcMPAxhNYBQS3avhMYFhAcMPAxhNYBQS3avhMYFhAcMPAxhNYBQS3avhMYFhAcMPAxhNYBQS3avhMYFhg4P6H9J0maYHXuiMlrXf+vOfA33Turf3C5SxNItAKCK4lsoFATkBwOUuTCLQCgmuJbCCQExBcztIkAq2A4FoiGwjkBASXszSJQCsguJbIBgI5AcHlLE0i0AoIriWygUBOQHA5S5MItAKCa4lsIJATEFzO0iQCrYDgWiIbCOQEBJezNIlAKyC4lsgGAjkBweUsTSLQCgiuJbKBQE5AcDlLkwi0Akff//Dz6U+/I6U1/sUNr3bnytl3kPzi4bXb/cK1RDYQyAkILmdpEoFWQHAtkQ0EcgKCy1maRKAVEFxLZAOBnIDgcpYmEWgFBNcS2UAgJyC4nKVJBFoBwbVENhDICQguZ2kSgVZAcC2RDQRyAoLLWZpEoBUQXEtkA4GcgOByliYRaAUE1xLZQCAnILicpUkEWgHBtUQ2EMgJCC5naRKBVkBwLZENBHIC/4M7TXIv+3PS22d24qvdQfL3C/7N5P5i/MLlLE0i0AoIriWygUBOQHA5S5MItAKCa4lsIJATEFzO0iQCrYDgWiIbCOQEBJezNIlAKyC4lsgGAjkBweUsTSLQCgiuJbKBQE5AcDlLkwi0AoJriWwgkBMQXM7SJAKtgOBaIhsI5AQEl7M0iUArILiWyAYCOQHB5SxNItAKCK4lsoFATkBwOUuTCBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIAAAQIECBAgQIDAvyrwDySEJ2VQgUSoAAAAAElFTkSuQmCC

View File

@@ -0,0 +1,12 @@
Books = Bücher
Book = Buch
Title = Titel
Description = Beschreibung
Stock = Bestand
Image = Bild
Price = Preis
Currency = Währung
Authors = Autoren
Author = Autor
AuthorID = ID des Autors

View File

@@ -0,0 +1,21 @@
Books = Books
Book = Book
ID = ID
Title = Title
Description = Description
Stock = Stock
Image = Image
Price = Price
Currency = Currency
Authors = Authors
Author = Author
AuthorID = Author''s ID
Name = Name
DateOfBirth = Date of Birth
DateOfDeath = Date of Death
PlaceOfBirth = Place of Birth
PlaceOfDeath = Place of Death
Genres = Genres
Genre = Genre

View File

@@ -0,0 +1,20 @@
Books = Livres
Book = Livre
Title = Titre
Description = Description
Stock = Action
Image = Image
Price = Prix
Currency = Devise
Authors = Auteurs
Author = Auteur
AuthorID = ID de l''auteur
Name = Nom
DateOfBirth = Date de naissance
DateOfDeath = Date de décès
PlaceOfBirth = Lieu de naissance
PlaceOfDeath = Lieu de décès
Genres = Genre
Genre = Genre

View File

@@ -0,0 +1,34 @@
400 = Ungültige Anfrage
401 = Nicht autorisiert
403 = Verboten
404 = Nicht gefunden
405 = Methode nicht zulässig
406 = Nicht akzeptabel
407 = Proxy-Authentifizierung erforderlich
408 = Anfrage-Timeout
409 = Konflikt
410 = Weg
411 = Erforderliche Länge
412 = Vorbedingung fehlgeschlagen
413 = Nutzlast zu groß
414 = URI zu lang
415 = Nicht unterstützter Medientyp
416 = Bereich nicht erfüllbar
417 = Erwartung fehlgeschlagen
422 = Nicht verarbeitbarer Inhalt
424 = Fehlgeschlagene Abhängigkeit
428 = Vorbedingung erforderlich
429 = Zu viele Anfragen
431 = Anfrage-Headerfelder zu groß
451 = Aus rechtlichen Gründen nicht verfügbar
500 = Interner Serverfehler
501 = Der Server unterstützt die zur Erfüllung der Anfrage erforderliche Funktionalität nicht
502 = Ungültiges Gateway
503 = Dienst nicht verfügbar
504 = Gateway-Timeout
ASSERT_RANGE = Wert {0} liegt nicht im angegebenen Bereich [{1}, {2}]
ASSERT_FORMAT = Wert "{0}" liegt nicht im angegebenen Format "{1}"
ASSERT_ARRAY = Wert muss ein Array sein
ASSERT_ENUM = Wert {0} ist gemäß Enumerationsdeklaration {{1}} ungültig
ASSERT_NOT_NULL = Wert ist erforderlich

View File

@@ -0,0 +1,34 @@
400 = Bad Request
401 = Unauthorized
403 = Forbidden
404 = Not Found
405 = Method Not Allowed
406 = Not Acceptable
407 = Proxy Authentication Required
408 = Request Timeout
409 = Conflict
410 = Gone
411 = Length Required
412 = Precondition Failed
413 = Payload Too Large
414 = URI Too Long
415 = Unsupported Media Type
416 = Range Not Satisfiable
417 = Expectation Failed
422 = Unprocessable Content
424 = Failed Dependency
428 = Precondition Required
429 = Too Many Requests
431 = Request Header Fields Too Large
451 = Unavailable For Legal Reasons
500 = Internal Server Error
501 = The server does not support the functionality required to fulfill the request
502 = Bad Gateway
503 = Service Unavailable
504 = Gateway Timeout
ASSERT_RANGE = Value {0} is not in specified range [{1}, {2}]
ASSERT_FORMAT = Value "{0}" is not in specified format "{1}"
ASSERT_ARRAY = Value must be an array
ASSERT_ENUM = Value {0} is invalid according to enum declaration {{1}}
ASSERT_NOT_NULL = Value is required

View File

@@ -0,0 +1,34 @@
400 = Requête incorrecte
401 = Non autorisée
403 = Interdite
404 = Introuvable
405 = Méthode non autorisée
406 = Non acceptable
407 = Authentification proxy requise
408 = Délai d''expiration de la requête
409 = Conflit
410 = Disparu
411 = Longueur requise
412 = Échec de la condition préalable
413 = Charge utile trop importante
414 = URI trop longue
415 = Type de média non pris en charge
416 = Plage non satisfaisante
417 = Échec de l''attente
422 = Contenu non traitable
424 = Dépendance échouée
428 = Condition préalable requise
429 = Trop de requêtes
431 = Champs d''en-tête de requête trop importants
451 = Indisponible pour des raisons juridiques
500 = Erreur interne du serveur
501 = Le serveur ne prend pas en charge la fonctionnalité requise pour répondre à la requête
502 = Passerelle incorrecte
503 = Service indisponible
504 = Délai d''attente de la passerelle
ASSERT_RANGE = La valeur {0} n''est pas dans la plage spécifiée [{1}, {2}]
ASSERT_FORMAT = La valeur "{0}" n''est pas au format spécifié "{1}"
ASSERT_ARRAY = La valeur doit être un tableau
ASSERT_ENUM = La valeur {0} n''est pas valide selon la déclaration d''énumération {{1}}
ASSERT_NOT_NULL = La valeur est obligatoire

View File

@@ -5,10 +5,15 @@ cds.once('served', require('./srv/mashup'))
// Add routes to UIs from imported packages
cds.once('bootstrap',(app)=>{
app.serve ('/bookshop') .from ('@capire/bookshop','app/vue')
app.serve ('/reviews') .from ('@capire/reviews','app/vue')
app.serve ('/orders') .from('@capire/orders','app/orders')
app.serve ('/data') .from('@capire/data-viewer','app/viewer')
try {
app.serve ('/bookshop') .from ('@capire/bookshop','app/vue')
app.serve ('/reviews') .from ('@capire/reviews','app/vue')
app.serve ('/orders') .from('@capire/orders','app/orders')
app.serve ('/data') .from('@capire/data-viewer','app/viewer')
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND') throw new Error('Run "npm ci" to install the required dependencies', { cause: err })
throw err
}
})
// Add Swagger UI

View File

@@ -18,7 +18,7 @@ module.exports = async()=>{ // called by server.js
// Note: prepend is neccessary to intercept generic default handler
//
CatalogService.prepend (srv => srv.on ('READ', 'Books/reviews', (req) => {
console.debug ('> delegating request to ReviewsService')
console.debug ('> delegating request to ReviewsService') // eslint-disable-line no-console
const [id] = req.params, { columns, limit } = req.query.SELECT
return ReviewsService.read ('Reviews',columns).limit(limit).where({subject:String(id)})
}))
@@ -40,7 +40,7 @@ module.exports = async()=>{ // called by server.js
// Update Books' average ratings when ReviewsService signals updated reviews
//
ReviewsService.on ('reviewed', (msg) => {
console.debug ('> received:', msg.event, msg.data)
console.debug ('> received:', msg.event, msg.data) // eslint-disable-line no-console
const { subject, count, rating } = msg.data
return UPDATE(Books,subject).with({ numberOfReviews:count, rating })
})
@@ -49,7 +49,7 @@ module.exports = async()=>{ // called by server.js
// Reduce stock of ordered books for orders are created from Orders admin UI
//
OrdersService.on ('OrderChanged', (msg) => {
console.debug ('> received:', msg.event, msg.data)
console.debug ('> received:', msg.event, msg.data) // eslint-disable-line no-console
const { product, deltaQuantity } = msg.data
return UPDATE (Books) .where ('ID =', product)
.and ('stock >=', deltaQuantity)

View File

@@ -12,11 +12,12 @@
#
GET {{reviews-service}}/Reviews
Authorization: Basic me:
###
POST {{reviews-service}}/Reviews
Authorization: Basic {{$processEnv USER}}:
Authorization: Basic me:
Content-Type: application/json
{"subject":"201", "title":"boo", "rating":3 }
@@ -41,7 +42,7 @@ GET {{bookshop}}/browse/Books(201)?
###
GET {{bookshop}}/browse/Books?
&$select=title,author&$expand=currency
&$select=title,author&$expand=currency
Accept-Language: de
#################################################
@@ -50,23 +51,23 @@ Accept-Language: de
#
@newOrderID = e939604c-ab83-4d4f-bdb6-95fe30b3773e
GET {{bookshop}}/orders/Orders
GET {{bookshop}}/odata/v4/orders/Orders
### Create order, still inactive
POST {{bookshop}}/orders/Orders
POST {{bookshop}}/odata/v4/orders/Orders
Content-Type: application/json
{"ID": "{{newOrderID}}"}
### Get inactive order. We have to specify `IsActiveEntity`.
GET {{bookshop}}/orders/Orders(ID={{newOrderID}},IsActiveEntity=false)
GET {{bookshop}}/odata/v4/orders/Orders(ID={{newOrderID}},IsActiveEntity=false)
### Activate order using `.../<servicename>.draftActivate`
POST {{bookshop}}/orders/Orders(ID={{newOrderID}},IsActiveEntity=false)/OrdersService.draftActivate
POST {{bookshop}}/odata/v4/orders/Orders(ID={{newOrderID}},IsActiveEntity=false)/OrdersService.draftActivate
Content-Type: application/json
### Get active order
GET {{bookshop}}/orders/Orders(ID={{newOrderID}},IsActiveEntity=true)
GET {{bookshop}}/odata/v4/orders/Orders(ID={{newOrderID}},IsActiveEntity=true)
### Create author
POST {{bookshop}}/admin/Authors

1
common/cds-plugin.js Normal file
View File

@@ -0,0 +1 @@
// dummy to auto-load the plugin

View File

@@ -4,5 +4,12 @@
"version": "1.0.0",
"dependencies": {
"@sap/cds": "*"
},
"cds": {
"requires": {
"@capire/common/data": {
"model": "@capire/common"
}
}
}
}

View File

@@ -18,7 +18,7 @@ class DataService extends cds.ApplicationService { init(){
.sort((e1, e2) => e1.name.localeCompare(e2.name))
.map(e => {
const columns = Object.entries(e.elements)
.filter(([_, el]) => !(el instanceof cds.Association)) // exclude assocs+compositions
.filter(([,el]) => !(el instanceof cds.Association)) // exclude assocs+compositions
.map(([name, el]) => { return { name, type: el.type, isKey:!!el.key }})
return { name: e.name, columns }
})
@@ -49,6 +49,7 @@ class DataService extends cds.ApplicationService { init(){
module.exports = { DataService }
/** @returns {cds.Service} */
function findDataSource(dataSourceName, entityName) {
for (let srv of Object.values(cds.services)) { // all connected services
if (!srv.name) continue // FIXME intermediate/pending in cds.services ?

20
eslint.config.mjs Normal file
View File

@@ -0,0 +1,20 @@
import cds from '@sap/cds/eslint.config.mjs'
export default [ ...cds.recommended ]
//
// The above is the recommended minimalistic eslint config, just using
// recommended defaults provided by cds. Alternatively, go for enhanced
// project-specific options, but only if really required, like this:
//
// export default [ ...cds.recommended, {
// rules: {
// 'complexity': [ 'warn', 66 ],
// 'require-await': 'warn',
// 'no-await-in-loop': 'warn',
// },
// }, {
// ignores: [
// '**/webapp/**'
// ]
// }]
//

View File

@@ -1,43 +0,0 @@
Books = Books
Book = Book
ID = ID
Title = Title
Author = Author
AuthorID = Author ID
Stock = Stock
Name = Name
Description = Description
Image = Image
AuthorName = Author's Name
DateOfBirth = Date of Birth
DateOfDeath = Date of Death
PlaceOfBirth = Place of Birth
PlaceOfDeath = Place of Death
Age = Age
Lifetime = Lifetime
Authors = Authors
Order = Order
Orders = Orders
OrderNo = Order Number
OrderItems = Order Items
Customer = Customer
Product = Product
ProductID = Product ID
ProductTitle = Product Title
UnitPrice = Unit Price
Quantity = Quantity
Price = Price
Currency = Currency
Date = Date
Rating = Rating
NumberOfReviews = Number of Reviews
Genre = Genre
Genres = Genres
SubGenres = Sub Genres
NumCode = Numeric Code
MinorUnit = Minor Unit
Exponent = Exponent

View File

@@ -1,14 +1,5 @@
Books = Bücher
Book = Buch
ID = ID
Title = Titel
Authors = Autoren
Author = Autor
AuthorID = ID des Autors
AuthorName = Name des Autors
Age = Alter
Name = Name
Stock = Bestand
Order = Bestellung
rder = Bestellung
Orders = Bestellungen
Price = Preis

View File

@@ -0,0 +1,8 @@
Age = Age
Lifetime = Lifetime
SubGenres = Sub Genres
NumCode = Numeric Code
MinorUnit = Minor Unit
Exponent = Exponent

View File

@@ -4,10 +4,10 @@ using CatalogService from '@capire/bookstore';
//
// Books Object Page
//
annotate CatalogService.Books with @(UI : {
annotate CatalogService.Book with @(UI : {
HeaderInfo : {
TypeName : 'Book',
TypeNamePlural : 'Books',
TypeName : '{i18n>Book}',
TypeNamePlural : '{i18n>Books}',
Description : {Value : author}
},
HeaderFacets : [{
@@ -24,7 +24,7 @@ annotate CatalogService.Books with @(UI : {
FieldGroup #Price : {Data : [
{Value : price},
{
Value : currency.symbol,
Value : currencyName,
Label : '{i18n>Currency}'
},
]},
@@ -35,11 +35,11 @@ annotate CatalogService.Books with @(UI : {
//
// Books List Page
//
annotate CatalogService.Books with @(UI : {
annotate CatalogService.Book with @(UI : {
SelectionFields : [
ID,
price,
currency_code
currencyName
],
LineItem : [
{
@@ -50,8 +50,10 @@ annotate CatalogService.Books with @(UI : {
Value : author,
Label : '{i18n>Author}'
},
{Value : genre.name},
{Value : genre},
{Value : price},
{Value : currency.symbol},
{Value : currencyName},
]
}, );
}) {
currencyName @Common.Label : '{i18n>Currency}';
};

View File

@@ -18,7 +18,6 @@ annotate my.Books with @(
ID,
author_ID,
price,
currency_code
],
LineItem : [
{ Value: ID, Label: '{i18n>Title}' },
@@ -26,7 +25,6 @@ annotate my.Books with @(
{ Value: genre.name },
{ Value: stock },
{ Value: price },
{ Value: currency.symbol },
]
}
) {
@@ -63,7 +61,7 @@ annotate my.Books with {
title @title: '{i18n>Title}';
genre @title: '{i18n>Genre}' @Common: { Text: genre.name, TextArrangement: #TextOnly };
author @title: '{i18n>Author}' @Common: { Text: author.name, TextArrangement: #TextOnly };
price @title: '{i18n>Price}' @Measures.ISOCurrency : currency_code;
price @title: '{i18n>Price}' @Measures.ISOCurrency : currency;
stock @title: '{i18n>Stock}';
descr @title: '{i18n>Description}' @UI.MultiLineText;
image @title: '{i18n>Image}';

View File

@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -10,21 +10,22 @@
<script>
window["sap-ushell-config"] = {
defaultRenderer: "fiori2",
applications: {}
applications: {},
};
</script>
<script id="sap-ushell-bootstrap" src="https://sapui5.hana.ondemand.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
<script id="sap-ui-bootstrap" src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout"
data-sap-ui-compatVersion="edge"
data-sap-ui-theme="sap_horizon"
data-sap-ui-frameOptions="allow"
></script>
<script id="sap-ushell-bootstrap" src="https://ui5.sap.com/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
<script id="sap-ui-bootstrap" src="https://ui5.sap.com/resources/sap-ui-core.js"
data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration, sap.ui.layout" data-sap-ui-compatVersion="edge"
data-sap-ui-theme="sap_horizon"></script>
<script>
sap.ui.getCore().attachInit(()=> sap.ushell.Container.createRenderer().placeAt("content"))
sap.ui.getCore().attachInit(() =>
sap.ushell.Container.createRenderer().placeAt("content")
);
</script>
</head>
<body class="sapUiBody" id="content"></body>
<body class="sapUiBody" id="content">
</body>
</html>

View File

@@ -1,8 +0,0 @@
// install OData v2 adapter
const cds = require("@sap/cds")
const proxy = require('@cap-js-community/odata-v2-adapter')
const opts = global.it ? { target:'auto' } : {} // for tests, set 'auto' to detect port dynamically
cds.on('bootstrap', app => app.use(proxy(opts))) // install proxy
// cds.log('cov2ap','silent') // suppress anoying log outpout, e.g. for `npm run mocha -- --reporter nyan`
module.exports = require('@capire/bookstore/server.js')

View File

@@ -3,40 +3,10 @@
"version": "1.0.0",
"scripts": {
"test": "npx jest --silent",
"start": "cds serve srv/world.cds",
"start": "cds-serve srv/world.cds",
"start:ts": "cds-ts serve srv/world.cds"
},
"dependencies": {
"@sap/cds": ">=5.0.4"
},
"devDependencies": {
"@types/jest": "*",
"@types/node": "*",
"typescript": ">=4.3.5"
},
"eslintConfig": {
"extends": "eslint:recommended",
"env": {
"es2020": true,
"node": true,
"jest": true,
"mocha": true
},
"globals": {
"SELECT": true,
"INSERT": true,
"UPDATE": true,
"DELETE": true,
"CREATE": true,
"DROP": true,
"CDL": true,
"CQL": true,
"CXL": true,
"cds": true
},
"rules": {
"no-console": "off",
"require-atomic-updates": "off"
}
}
}

View File

@@ -1,3 +1,3 @@
service say @(path: '/say') {
service say {
function hello (to:String) returns String;
}
}

View File

@@ -1,13 +0,0 @@
const cds = require ('@sap/cds')
describe('Hello world!', () => {
beforeAll (()=> process.env.CDS_TYPESCRIPT = true)
afterAll (()=> delete process.env.CDS_TYPESCRIPT)
const {GET} = cds.test.in(__dirname,'../srv').run('serve', 'world.cds')
it('should say hello with class impl', async () => {
const {data} = await GET`/say/hello(to='world')`
expect(data.value).toMatch(/Hello world.*typescript.*/i)
})
})

View File

@@ -1 +1,5 @@
GET http://localhost:4004/say/hello(to='world')
GET http://localhost:4004/odata/v4/say/hello
###
GET http://localhost:4004/odata/v4/say/hello(to='me')
###

View File

@@ -13,10 +13,5 @@
"scripts": {
"start": "cds-serve",
"watch": "cds watch"
},
"cds": {
"requires": {
"db": "sql"
}
}
}

View File

@@ -1,4 +1,4 @@
const cds = require ('@sap/cds/lib')
const cds = require ('@sap/cds')
const LOG = cds.log('cds.log')
module.exports = class LogService extends cds.Service {

View File

@@ -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 ;
}

View File

@@ -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)

View File

@@ -0,0 +1,3 @@
Order = Bestellung
Orders = Bestellungen
Price = Preis

View File

@@ -0,0 +1,10 @@
Order = Order
Orders = Orders
OrderNo = Order Number
OrderItems = Order Items
Customer = Customer
Product = Product
ProductID = Product ID
ProductTitle = Product Title
UnitPrice = Unit Price
Quantity = Quantity

View File

@@ -0,0 +1,10 @@
Order = Order
Orders = Orders
OrderNo = Numéro de commande
OrderItems = Articles de la commande
Customer = Client
Product = Produit
ProductID = ID du produit
ProductTitle = Titre du produit
UnitPrice = Prix unitaire
Quantity = Quantité

View File

@@ -2,7 +2,7 @@ using { Currency, User, managed, cuid } from '@sap/cds/common';
namespace sap.capire.orders;
entity Orders : cuid, managed {
OrderNo : String(22) @title:'Order Number'; //> readable key
OrderNo : String(44) @title:'Order Number'; //> readable key
Items : Composition of many {
key ID : UUID;
product : Association to Products;

View File

@@ -29,7 +29,7 @@ class OrdersService extends cds.ApplicationService {
/** order changed -> broadcast event */
orderChanged (product, deltaQuantity) {
// Emit events to inform subscribers about changes in orders
console.log ('> emitting:', 'OrderChanged', { product, deltaQuantity })
console.log ('> emitting:', 'OrderChanged', { product, deltaQuantity }) // eslint-disable-line no-console
return this.emit ('OrderChanged', { product, deltaQuantity })
}

6708
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,56 +1,51 @@
{
"name": "@capire/samples",
"version": "2.0.0",
"description": "A monorepo with several samples for CAP.",
"repository": "https://github.com/sap-samples/cloud-cap-samples.git",
"author": "daniel.hutzel@sap.com",
"dependencies": {
"@sap/cds": ">=7"
},
"workspaces": [
"./bookshop",
"./bookstore",
"./common",
"./data-viewer",
"./fiori",
"./hello",
"./media",
"./orders",
"./loggers",
"./reviews"
],
"devDependencies": {
"@cap-js/sqlite": "^1",
"@sap/eslint-plugin-cds": "^2.6.1",
"axios": "^1",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
"semver": "^7"
},
"scripts": {
"cleanup": "rm -rf node_modules && rm -rf */node_modules && rm -rf */*/node_modules",
"bookshop": "cds watch bookshop",
"fiori": "cds watch fiori",
"hello": "cds watch hello",
"media": "cds watch media",
"mocha": "CDS_TEST_SILENT=y npx mocha",
"jest": "npx jest --silent",
"start": "cds watch fiori",
"test": "npm run jest -- --silent",
"test:hello": "cd hello && npm test"
},
"jest": {
"testTimeout": 20000,
"testMatch": [
"**/*.test.js"
]
},
"mocha": {
"recursive": true,
"parallel": true,
"timeout": 6666
},
"license": "SEE LICENSE IN LICENSE",
"private": true
"name": "@capire/samples",
"version": "2.1.0",
"description": "A monorepo with several samples for CAP.",
"repository": "https://github.com/sap-samples/cloud-cap-samples.git",
"author": "daniel.hutzel@sap.com",
"dependencies": {
"@sap/cds": ">=8"
},
"workspaces": [
"./bookshop",
"./bookstore",
"./common",
"./data-viewer",
"./fiori",
"./hello",
"./media",
"./orders",
"./loggers",
"./reviews"
],
"devDependencies": {
"@cap-js/cds-types": "^0",
"@cap-js/sqlite": "^1",
"axios": "^1",
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"chai-subset": "^1.6.0",
"eslint": "^9",
"semver": "^7"
},
"scripts": {
"bookshop": "cds watch bookshop",
"start": "cds watch fiori",
"fiori": "cds watch fiori",
"hello": "cds watch hello",
"media": "cds watch media",
"lint": "eslint",
"test": "npx jest --silent",
"jest": "npx jest --silent",
"mocha": "CDS_TEST_SILENT=y npx mocha",
"test:hello": "cd hello && npm test"
},
"mocha": {
"recursive": true,
"parallel": true,
"timeout": 6666
},
"license": "SEE LICENSE IN LICENSE",
"private": true
}

View File

@@ -0,0 +1,3 @@
Date = Datum
Rating = Bewertung
NumberOfReviews = Anzahl der Reviews

View File

@@ -0,0 +1,5 @@
Reviews = Reviews
Review = Review
Date = Date
Rating = Rating
NumberOfReviews = Number of Reviews

View File

@@ -0,0 +1,5 @@
Reviews = Avis
Review = Avis
Date = Date
Rating = Note
NumberOfReviews = Nombre d''avis

View File

@@ -50,7 +50,6 @@ const reviews = Vue.createApp ({
const res = await POST(`/Reviews`,review)
reviews.ID = res.data.ID
} else {
console.trace()
await PUT(`/Reviews/${review.ID}`,review)
}
reviews.message = { succeeded: 'Your review was submitted successfully. Thanks.' }

View File

@@ -15,7 +15,7 @@ module.exports = cds.service.impl (function(){
const { count, rating } = await cds.tx(req) .run (
SELECT.one `round(avg(rating),2) as rating, count(*) as count` .from (Reviews) .where ({subject})
)
global.it || console.log ('< emitting:', 'reviewed', { subject, count, rating })
global.it || console.log ('< emitting:', 'reviewed', { subject, count, rating }) // eslint-disable-line no-console
await this.emit ('reviewed', { subject, count, rating })
})

View File

@@ -1,7 +1,8 @@
const cds = require('@sap/cds')
const { expect } = cds.test
describe('cds.ql → cqn', () => {
const cds = require('@sap/cds/lib')
const { expect } = cds.test
const Foo = { name: 'Foo' }
const Books = { name: 'capire.bookshop.Books' }
@@ -676,7 +677,7 @@ describe('cds.ql → cqn', () => {
.to.eql(INSERT.into(Foo).entries(...entries))
.to.eql(INSERT.into(Foo).entries(entries))
.to.eql({
INSERT: { into: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] }, entries },
INSERT: { into: { ref: ['Foo'] }, entries },
})
})
@@ -692,7 +693,7 @@ describe('cds.ql → cqn', () => {
.to.eql(INSERT.into(Foo).columns('a', 'b').rows([1, 2], [3, 4]))
.to.eql({
INSERT: {
into: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
into: { ref: ['Foo'] },
columns: ['a', 'b'],
rows: [
[1, 2],
@@ -706,7 +707,7 @@ describe('cds.ql → cqn', () => {
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: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] },
INSERT: { into: { ref: ['Foo'] }, columns: ['a', 'b'], values: [1, 2] },
})
})
@@ -721,7 +722,7 @@ describe('cds.ql → cqn', () => {
test('entity (..., <key>)', () => {
const cqnWhere = {
UPDATE: {
entity: cds.env.ql.quirks_mode ? 'capire.bookshop.Books' : { ref: ['capire.bookshop.Books'] },
entity: { ref: ['capire.bookshop.Books'] },
where: [{ ref: ['ID'] }, '=', { val: 4711 }],
},
}
@@ -765,7 +766,7 @@ describe('cds.ql → cqn', () => {
.to.eql(UPDATE(Foo).with({ foo: 11, bar: { '-=': 22 } }))
.to.eql({
UPDATE: {
entity: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
entity: { ref: ['Foo'] },
data: { foo: 11 },
with: {
bar: { xpr: [{ ref: ['bar'] }, '-', { val: 22 }] },
@@ -776,7 +777,7 @@ describe('cds.ql → cqn', () => {
// some more
expect(UPDATE(Foo).with(`bar = coalesce(x,y), car = 'foo''s bar, car'`)).to.eql({
UPDATE: {
entity: cds.env.ql.quirks_mode ? 'Foo' : { ref: ['Foo'] },
entity: { ref: ['Foo'] },
data: {
car: "foo's bar, car",
},
@@ -796,7 +797,7 @@ describe('cds.ql → cqn', () => {
test('from (..., <key>)', () => {
const cqnWhere = {
DELETE: {
from: cds.env.ql.quirks_mode ? 'capire.bookshop.Books' : { ref: ['capire.bookshop.Books'] },
from: { ref: ['capire.bookshop.Books'] },
where: [{ ref: ['ID'] }, '=', { val: 4711 }],
},
}

View File

@@ -0,0 +1,53 @@
const cds = require("@sap/cds");
const { expect } = cds.test(
"serve",
"CatalogService",
"--from",
"@capire/bookshop,@capire/common",
"--in-memory"
);
describe("Consuming actions locally", () => {
let cats, CatalogService, Books, stockBefore;
const BOOK_ID = 251;
const QUANTITY = 1;
before("bootstrap the database", async () => {
CatalogService = cds.services.CatalogService;
expect(CatalogService).not.to.be.undefined;
Books = CatalogService.entities.Books;
expect(Books).not.to.be.undefined;
cats = await cds.connect.to("CatalogService");
});
beforeEach(async () => {
// Read the stock before the action is called
stockBefore = (await cats.get(Books, BOOK_ID)).stock;
});
it("calls unbound actions - basic variant using srv.send", async () => {
// Use a managed transaction to create a continuation with an authenticated user
const res1 = await cats.tx({ user: "alice" }, () => {
return cats.send("submitOrder", { book: BOOK_ID, quantity: QUANTITY });
});
expect(res1.stock).to.eql(stockBefore - QUANTITY);
});
it("calls unbound actions - named args variant", async () => {
// Use a managed transaction to create a continuation with an authenticated user
const res2 = await cats.tx({ user: "alice" }, () => {
return cats.submitOrder({ book: BOOK_ID, quantity: QUANTITY });
});
expect(res2.stock).to.eql(stockBefore - QUANTITY);
});
it("calls unbound actions - positional args variant", async () => {
// Use a managed transaction to create a continuation with an authenticated user
const res3 = await cats.tx({ user: "alice" }, () => {
return cats.submitOrder(BOOK_ID, QUANTITY);
});
expect(res3.stock).to.eql(stockBefore - QUANTITY);
});
});

View File

@@ -1,4 +1,4 @@
const cds = require('@sap/cds/lib')
const cds = require('@sap/cds')
describe('cap/samples - Consuming Services locally', () => {

View File

@@ -1,4 +1,4 @@
const cds = require('@sap/cds/lib')
const cds = require('@sap/cds')
describe('cap/samples - Custom Handlers', () => {
@@ -8,9 +8,10 @@ describe('cap/samples - Custom Handlers', () => {
})
it('should reject out-of-stock orders', async () => {
await POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`
await POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`
await expect(POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`).to.be.rejectedWith(/409 - 5 exceeds stock for book #201/)
await expect(POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`).to.be.fulfilled
await expect(POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`).to.be.fulfilled
await expect(POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`).to.be.rejectedWith(
/409 - 5 exceeds stock for book #201/)
const { data } = await GET`/admin/Books/201/stock/$value`
expect(data).to.equal(2)
})

View File

@@ -1,4 +1,8 @@
const cds = require('@sap/cds/lib')
// Quick hack: suppress deprecation warnings w/ Node22 caused by http-proxy (used by OData v2 proxy)
// See also: https://github.com/http-party/node-http-proxy/pull/1666
require('util')._extend = Object.assign
const cds = require('@sap/cds')
describe('cap/samples - Fiori APIs - v2', function() {

View File

@@ -1,11 +1,11 @@
const cds = require('@sap/cds/lib')
const cds = require('@sap/cds')
describe('cap/samples - Hello world!', () => {
const { GET, expect } = cds.test (__dirname+'/../hello')
it('should say hello with class impl', async () => {
const {data} = await GET `/say/hello(to='world')`
const {data} = await GET `/odata/v4/say/hello(to='world')`
expect(data.value).to.eql('Hello world!')
})

View File

@@ -1,4 +1,4 @@
const cds = require('@sap/cds/lib')
const cds = require('@sap/cds')
const { expect } = cds.test.in(__dirname,'..')
describe('cap/samples - Hierarchical Data', ()=>{
@@ -77,49 +77,45 @@ describe('cap/samples - Hierarchical Data', ()=>{
)
})
it ('supports nested reads', async()=>{
expect (await
SELECT.one.from (Cats, c=>{
c.ID, c.name.as('parent'), c.children (c=>{
c.name.as('child')
})
}) .where ({name:'Cat'})
) .to.eql (
{ ID:101, parent:'Cat', children:[
{ child:'Kitty' },
{ child:'Catwoman' },
]}
)
})
it ('supports nested reads', ()=> expect (
SELECT.one.from (Cats, c=>{
c.ID, c.name.as('parent'), c.children (c=>{
c.name.as('child')
})
}) .where ({name:'Cat'})
) .to.eventually.eql (
{ ID:101, parent:'Cat', children:[
{ child:'Kitty' },
{ child:'Catwoman' },
]}
))
it ('supports deeply nested reads', async()=>{
expect (await SELECT.one.from (Cats, c=>{
it ('supports deeply nested reads', ()=> expect (
SELECT.one.from (Cats, c=>{
c.ID, c.name, c.children (
c => { c.name },
{levels:3}
)
}) .where ({name:'Cat'})
) .to.eql (
{ ID:101, name:'Cat', children:[
{ name:'Kitty', children:[
{ name:'Kitty Cat', children:[
{ name:'Aristocat' }, ]}, // level 3
{ name:'Kitty Bat', children:[] }, ]},
{ name:'Catwoman', children:[
{ name:'Catalina', children:[] } ]},
]}
)
})
) .to.eventually.eql (
{ ID:101, name:'Cat', children:[
{ name:'Kitty', children:[
{ name:'Kitty Cat', children:[
{ name:'Aristocat' }, ]}, // level 3
{ name:'Kitty Bat', children:[] }, ]},
{ name:'Catwoman', children:[
{ name:'Catalina', children:[] } ]},
]}
))
it ('supports cascaded deletes', async()=>{
const affectedRows = await DELETE.from (Cats) .where ({ID:[102,106]})
expect (affectedRows) .to.be.greaterThan (0)
const expected = [
await expect (SELECT`ID,name`.from(Cats) ).to.eventually.eql ([
{ ID:100, name:'Some Cats...' },
{ ID:101, name:'Cat' },
{ ID:108, name:'Catweazle' }
]
expect ( await SELECT`ID,name`.from(Cats) ).to.eql (expected)
])
})
})

View File

@@ -1,4 +1,4 @@
const cds = require('@sap/cds/lib')
const cds = require('@sap/cds')
describe('cap/samples - Localized Data', () => {
@@ -27,15 +27,15 @@ describe('cap/samples - Localized Data', () => {
})
it('supports queries with $expand', async () => {
const { data } = await GET(`/browse/Books?&$select=title,author&$expand=currency`, {
const { data } = await GET(`/browse/Book?&$select=title,author,currencyName`, {
headers: { 'Accept-Language': 'de' },
})
expect(data.value).to.containSubset([
{ title: 'Sturmhöhe', author: 'Emily Brontë', currency: { name: 'Pfund' } },
{ title: 'Jane Eyre', author: 'Charlotte Brontë', currency: { name: 'Pfund' } },
{ title: 'The Raven', author: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } },
{ title: 'Eleonora', author: 'Edgar Allen Poe', currency: { name: 'US-Dollar' } },
{ title: 'Catweazle', author: 'Richard Carpenter', currency: { name: 'Yen' } },
{ title: 'Sturmhöhe', author: 'Emily Brontë', currencyName: 'Pfund' },
{ title: 'Jane Eyre', author: 'Charlotte Brontë', currencyName: 'Pfund' },
{ title: 'The Raven', author: 'Edgar Allen Poe', currencyName: 'US-Dollar' },
{ title: 'Eleonora', author: 'Edgar Allen Poe', currencyName: 'US-Dollar' },
{ title: 'Catweazle', author: 'Richard Carpenter', currencyName: 'Yen' },
])
})

View File

@@ -1,4 +1,4 @@
const cds = require('@sap/cds/lib')
const cds = require('@sap/cds')
describe('cap/samples - Messaging', ()=>{

View File

@@ -1,4 +1,4 @@
const cds = require('@sap/cds/lib')
const cds = require('@sap/cds')
describe('cap/samples - Bookshop APIs', () => {
const { GET, expect, axios } = cds.test ('@capire/bookshop')
@@ -8,83 +8,87 @@ describe('cap/samples - Bookshop APIs', () => {
const { headers, status, data } = await GET `/browse/$metadata`
expect(status).to.equal(200)
expect(headers).to.contain({
'content-type': 'application/xml',
// 'content-type': 'application/xml', //> fails with 'application/xml;charset=utf-8', which is set by express
'odata-version': '4.0',
})
expect(data).to.contain('<EntitySet Name="Books" EntityType="CatalogService.Books">')
expect(data).to.contain('<Annotation Term="Common.Label" String="Currency"/>')
expect(headers['content-type']).to.match(/application\/xml/)
expect(data).to.contain('<EntitySet Name="Books" EntityType="CatalogService.Books"/>')
expect(data).to.contain('<Annotation Term="Common.Label" String="Currency Symbol"/>')
})
it('serves ListOfBooks?$expand=genre,currency', async () => {
it('serves Books?$expand=genre,currency', async () => {
const Mystery = { ID: 16, name: 'Mystery', descr: null, parent_ID: 10 }
const Romance = { ID: 15, name: 'Romance', descr: null, parent_ID: 10 }
const USD = { code: 'USD', name: 'US Dollar', descr: null, symbol: '$' }
const { data } = await GET `/browse/ListOfBooks ${{
const { data } = await GET `/admin/Books ${{
params: { $search: 'Po', $select: `title,author`, $expand:`genre,currency` },
}}`
expect(data.value).to.containSubset([
{ ID: 251, title: 'The Raven', author: 'Edgar Allen Poe', genre:Mystery, currency:USD },
{ ID: 252, title: 'Eleonora', author: 'Edgar Allen Poe', genre:Romance, currency:USD },
{ ID: 251, title: 'The Raven', author_ID: 150, genre:Mystery, currency:USD },
{ ID: 252, title: 'Eleonora', author_ID: 150, genre:Romance, currency:USD },
])
})
it('supports $search in multiple fields', async () => {
const { data } = await GET `/browse/Books ${{
params: { $search: 'Po', $select: `title,author` },
}}`
expect(data.value).to.containSubset([
{ ID: 201, title: 'Wuthering Heights', author: 'Emily Brontë' },
{ ID: 207, title: 'Jane Eyre', author: 'Charlotte Brontë' },
{ ID: 251, title: 'The Raven', author: 'Edgar Allen Poe' },
{ ID: 252, title: 'Eleonora', author: 'Edgar Allen Poe' },
])
})
describe('query options...', () => {
it('supports $select', async () => {
const { data } = await GET(`/browse/Books`, {
params: { $select: `ID,title` },
it('supports $search in multiple fields', async () => {
const { data } = await GET `/browse/Books ${{
params: { $search: 'Po', $select: `title,author` },
}}`
expect(data.value).to.containSubset([
{ ID: 201, title: 'Wuthering Heights', author: 'Emily Brontë' },
{ ID: 207, title: 'Jane Eyre', author: 'Charlotte Brontë' },
{ ID: 251, title: 'The Raven', author: 'Edgar Allen Poe' },
{ ID: 252, title: 'Eleonora', author: 'Edgar Allen Poe' },
])
})
expect(data.value).to.containSubset([
{ ID: 201, title: 'Wuthering Heights' },
{ ID: 207, title: 'Jane Eyre' },
{ ID: 251, title: 'The Raven' },
{ ID: 252, title: 'Eleonora' },
{ ID: 271, title: 'Catweazle' },
])
})
it('supports $expand', async () => {
const { data } = await GET(`/admin/Authors`, {
params: {
$select: `name`,
$expand: `books($select=title)`,
},
it('supports $select', async () => {
const { data } = await GET(`/browse/Books`, {
params: { $select: `ID,title` },
})
expect(data.value).to.containSubset([
{ ID: 201, title: 'Wuthering Heights' },
{ ID: 207, title: 'Jane Eyre' },
{ ID: 251, title: 'The Raven' },
{ ID: 252, title: 'Eleonora' },
{ ID: 271, title: 'Catweazle' },
])
})
expect(data.value).to.containSubset([
{ name: 'Emily Brontë', books: [{ title: 'Wuthering Heights' }] },
{ name: 'Charlotte Brontë', books: [{ title: 'Jane Eyre' }] },
{ name: 'Edgar Allen Poe', books: [{ title: 'The Raven' }, { title: 'Eleonora' }] },
{ name: 'Richard Carpenter', books: [{ title: 'Catweazle' }] },
])
})
it('supports $value requests', async () => {
const { data } = await GET`/admin/Books/201/stock/$value`
expect(data).to.equal(12)
})
it('supports $expand', async () => {
const { data } = await GET(`/admin/Authors`, {
params: {
$select: `name`,
$expand: `books($select=title)`,
},
})
expect(data.value).to.containSubset([
{ name: 'Emily Brontë', books: [{ title: 'Wuthering Heights' }] },
{ name: 'Charlotte Brontë', books: [{ title: 'Jane Eyre' }] },
{ name: 'Edgar Allen Poe', books: [{ title: 'The Raven' }, { title: 'Eleonora' }] },
{ name: 'Richard Carpenter', books: [{ title: 'Catweazle' }] },
])
})
it('supports $top/$skip paging', async () => {
const { data: p1 } = await GET`/browse/Books?$select=title&$top=3`
expect(p1.value).to.containSubset([
{ ID: 201, title: 'Wuthering Heights' },
{ ID: 207, title: 'Jane Eyre' },
{ ID: 251, title: 'The Raven' },
])
const { data: p2 } = await GET`/browse/Books?$select=title&$skip=3`
expect(p2.value).to.containSubset([
{ ID: 252, title: 'Eleonora' },
{ ID: 271, title: 'Catweazle' },
])
it('supports $value requests', async () => {
const { data } = await GET`/admin/Books/201/stock/$value`
expect(data).to.equal(12)
})
it('supports $top/$skip paging', async () => {
const { data: p1 } = await GET`/browse/Books?$select=title&$top=3`
expect(p1.value).to.containSubset([
{ ID: 201, title: 'Wuthering Heights' },
{ ID: 207, title: 'Jane Eyre' },
{ ID: 251, title: 'The Raven' },
])
const { data: p2 } = await GET`/browse/Books?$select=title&$skip=3`
expect(p2.value).to.containSubset([
{ ID: 252, title: 'Eleonora' },
{ ID: 271, title: 'Catweazle' },
])
})
})
it('serves user info', async () => {